🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #5436

Re: TIdIRC Access Violation

#5436
From: Remy Lebeau (TeamB)
Date: Wed, 08 Sep 2004 23:37
35 lines
2006 bytes
<Tog> wrote in message news:413f93a5$1@newsgroups.borland.com...

> If I join a channel first, and some OP that hasn't been
> there joins, and ChanServ sets +o on that person,
> ATarget->Nick has no value!!??

Not possible.  The Nick was used to find the TIdIRCUser instance in the
first place, so it has to be valid.

> So in that ONE case where the person hasn't been
> in the channel before, and chanserv op's him, I get
> an access violation.

Please show your actual code.  An AV occurs when you access invalid memory.
The only way that can happen when accessing the Nick property is if ATarget
is invalid to begin with.  Sounds like you not checking ATarget for NULL
before trying to access it.

> From the debug I get this trying to read the nick value:
>
> 'E2208 Cannot access an inactive scope'
> or
> '??????'

That usually means thatyou are accessing a NULL pointer.

> I just don't see why ATarget->Nick wouldn't have a value
> in the case where it gets an AV other than a Indy bug.

The user probably wasn't found in the Users list to begin with, so ATarget
was NULL and you did not check for that.


Gambit
Technical Details
Message-ID: <413f973c$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <413f93a5$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,d6069b12da25a878
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <413f93a5$1@newsgroups.borland.com>
Subject: Re: TIdIRC Access Violation
Date: Wed, 8 Sep 2004 16:37:11 -0700
Lines: 37
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <413f973c$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1094686524 68.69.17.41 (8 Sep 2004 16:35:24 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail