Can Q_GLOBAL_STATIC replace KStaticDelete ?

Matthias Kretz Matthias.Kretz at
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 

> 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)                            <><
MatthiasKretz at, kretz at,
Matthias.Kretz at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <>

More information about the kde-core-devel mailing list