Can Q_GLOBAL_STATIC replace KStaticDelete ?

Thiago Macieira thiago at
Mon Jan 8 18:56:10 GMT 2007

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

I saw the commit, but it doesn't explain why there is such a requirement.

Why must those objects be deleted before QCoreApplication does away? Or 
why must they be deleted between QCoreApplication's destructor and the 
application's real exit?

What happens to those objects if the application exits without 
QCoreApplication's destructor running?
  Thiago Macieira  -  thiago (AT) - thiago (AT)
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- 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