strange KStaticDeleter usage

Olivier Goffart ogoffart at kde.org
Thu Apr 26 13:05:03 BST 2007


Le jeudi 26 avril 2007, David Faure a écrit :
> 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.

maybe using the same design pattern as KMessage / KMessageHandler

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070426/94f7e8f8/attachment.sig>


More information about the kde-core-devel mailing list