Can Q_GLOBAL_STATIC replace KStaticDelete ?
kretz at kde.org
Thu Jan 18 21:22:57 GMT 2007
On Thursday 18 January 2007 20:31, Thiago Macieira wrote:
> Matthias Kretz wrote:
> >The problem is that as soon as you keep any KDE object as a member of a
> > static object you have to be sure it's not going to need a KInstance
> > object on destruction. Do you know whether you're allowed to keep a
> > KDirWatch object? Would you have known that keeping a dirty KConfig
> > object until destruction will crash your program on exit?
> This indicates that the problem is elsewhere. KInstance should be
> refcounted by the number of objects that reference it. It should only be
> deleted when that refcount drops to zero.
Sounds like a good idea to me.
Problem to solve: KApplication derives from KInstance. So if KApplication is
destructed before the global statics how could KInstance keep itself alive
long enough? I guess KInstance then has to be a member of KApplication. What
implications does that have on existing code?
Matthias Kretz (Germany) <><
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
More information about the kde-core-devel