Can Q_GLOBAL_STATIC replace KStaticDelete ?

George Staikos staikos at kde.org
Mon Jan 8 19:58:44 GMT 2007


Quoting Thiago Macieira <thiago at kde.org>:

> 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?

  I have had issues in the past with text codecs being destroyed and then when
global statics were destroyed, they would try to access the deleted text codec.
 Ugly situation...


-- 
George Staikos 





More information about the kde-core-devel mailing list