strange KStaticDeleter usage

David Faure faure at kde.org
Thu Apr 26 12:31:05 BST 2007


On Thursday 26 April 2007, Thiago Macieira wrote:
> David Faure wrote:
> >This is a hook for applications like kontact, which can reimplement the
> > behavior. kontact creates and instanciates a derived class, which sets
> > it as the singleton instead of the kdelibs one, and everything goes
> > through it instead of using the default implementation from kdelibs.
> 
> That's a pure singleton behaviour, which is acceptable. It's not a global 
> static behaviour.

And how do you implement a singleton (with a base and a derived class)
without a global static? Apart from using KStaticDeleter? :-)
We need something that deletes singletons at the end of the process, to make
memory leak debugging simpler, and that's what KStaticDeleter was doing up to now.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list