[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Got some bugs here
From:       Simon Hausmann <hausmann () kde ! org>
Date:       2002-01-30 20:11:09
[Download RAW message or body]

On Wed, Jan 30, 2002 at 09:11:01PM +0100, Martijn Klingens wrote:
> On Wednesday 30 January 2002 20:49, Michael Brade wrote:
> > But I found that KFileMetaInfo is using a KStaticDeleter as well - so is it
> > possible that one of the static deleters is deleted too early or too late?
> > Has anybody a tool for searching already deleted pointers that are accessed
> > again later?
> 
> I think a good habit would be to do the C++ equivalent of Delphi's FreeAndNil 
> function, i.e. free the pointer *and* set it to NULL, so the backtrace makes 
> it instantly clear that you are trying to access a null pointer afterwards.

KStaticDeleter does that. Upon registration of your singleton with
your static deleter you pass a reference to the variable (pointer) holding it.


Simon
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic