Can Q_GLOBAL_STATIC replace KStaticDelete ?

Matthias Kretz Matthias.Kretz at urz.uni-heidelberg.de
Mon Jan 8 17:51:35 GMT 2007


Only saw your email after I sent mine...

On Monday 08 January 2007 16:50, Olivier Goffart wrote:
> - KStaticDeleter delete objects in  ~KApplication ,  while Q_GLOBAL_STATIC
> delete object after the end of main()

This is a blocker for Q_GLOBAL_STATIC in many places of KDE. Many things must 
be cleaned up before QCoreApplication is gone (just see my latest commit to 
kdelibs/phonon).

> If there is no KApplication, object are destroyed in the same time for both
> Q_GLOBAL_STATIC and KStaticDeleter.

Which is a regression - in KDE3 there were no KStaticDeleters without a 
KApplication, AFAIK.

> Is there any place where the static object is required to be destroyed
> before KApplication ?

I don't think KApplication is needed anymore at object destruction, but 
QCoreApplication often is.

> So what is your opinion ?

Use Q_GLOBAL_STATIC and find a simple way to delete the static objects before 
QCoreApplication is gone.

-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
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
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070108/72b861dd/attachment.sig>


More information about the kde-core-devel mailing list