From kde-commits Thu Jan 08 16:40:23 2009 From: David Faure Date: Thu, 08 Jan 2009 16:40:23 +0000 To: kde-commits Subject: Re: KDE/kdepim Message-Id: <200901081740.24039.dfaure () kdab ! net> X-MARC-Message: https://marc.info/?l=kde-commits&m=123143287203163 On Wednesday 07 January 2009, Thomas McGuire wrote: > +#ifdef Q_WS_MACX > + // ### This quits the application prematurely, for example when the composer window > + // ### is closed while the main application is minimized to the systray > + connect( qApp, SIGNAL(lastWindowClosed()), qApp, SLOT(quit())); > +#endif Yep, the comment is right, this is exactly why you should not have such a connect in kmail or kontact... Instead, KDE apps use the KGlobal::ref/deref mechanism. Each user-visible thing that should keep the app alive does a ref on creation and a deref on destruction, like kmainwindows, systray icons, running kio jobs, etc. More info in the apidox for KGlobal::ref(). If the app doesn't exit, then you'll have to debug where the remaining ref(s) are. No idea off hand why it would be different on the mac though. Note that the kdelibs code for this (kglobal, kmainwindow and ksystemtray) has been changed until a few months ago, so it would be worth just removing the connect and trying again with kdelibs-4.2 or trunk. -- David Faure, faure@kde.org, dfaure@kdab.net KDE/KOffice developer, Qt consultancy projects Klarälvdalens Datakonsult AB, Platform-independent software solutions