2008/10/28, Michael Leupold : > Hi George, > > > On Tuesday 28 October 2008, George Kiagiadakis wrote: > > > Kopete uses a function static instance of its Kopete::WalletManager > > > (which in turn uses KWallet::Wallet) to manage the connection to the > > > wallet. If there's an open wallet connection on quitting kopete it is > > > closed in > > > Kopete::WalletManager's dtor. Unfortunately the static destruction > > > sequence might destroy KWallet::Wallet's static dbus interface before > > > Kopete gets to closing the wallet. > > > How about a K_GLOBAL_STATIC? Something like this: > > > > K_GLOBAL_STATIC(Kopete::WalletManager, static_walletManager) > > Kopete::WalletManager *Kopete::WalletManager::self() > > { > > return static_walletManager; > > } > > > > This should be safer imho, because I am not sure if connecting > > QCoreApplication::aboutToQuit() to WalletManager::deleteLater() will > > actually delete the object, as the time aboutToQuit() is emited, the > > eventloop is exiting and deleteLater() deletes the object the next > > time the event loop is run. > > > That's what KWallet::Wallet is using. I think I tried that one but it doesn't > guarantee the destruction order, so if you have > K_GLOBAL_STATIC(A, globalA) > K_GLOBAL_STATIC(B, globalB) > in different files you have no guarantee as to which is destructed first. > > Regards, > > Michael Ah, now I understand what the problem really is... I am sorry, my mistake. >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<