Commit f4de70ae authored by Christian Ehrlicher's avatar Christian Ehrlicher
Browse files

next try (avoid infinite recursion), now mailtransport test is working fine...

next try (avoid infinite recursion), now mailtransport test is working fine and cleanup is also done

CCMAIL: vkrause@kde.org

svn path=/trunk/KDE/kdepimlibs/; revision=664885
parent 2fa0254d
......@@ -48,6 +48,10 @@ using namespace KWallet;
*/
class TransportManager::Private {
public:
~Private() {
qRemovePostRoutine(cleanupTransportManager);
cleanupTransportManager();
}
KConfig *config;
QList<Transport*> transports;
bool myOwnChange;
......@@ -58,9 +62,14 @@ class TransportManager::Private {
bool isMainInstance;
QList<TransportJob*> walletQueue;
static TransportManager sSelf;
static TransportManager *sSelf;
static void cleanupTransportManager()
{
delete sSelf;
sSelf = 0;
}
};
TransportManager TransportManager::Private::sSelf;
TransportManager *TransportManager::Private::sSelf = 0;
TransportManager::TransportManager() :
QObject(), d( new Private )
......@@ -96,12 +105,11 @@ TransportManager::~TransportManager()
TransportManager* TransportManager::self()
{
static TransportManager::Private p;
static bool bInit = false;
if(!bInit) {
bInit = true;
p.sSelf.readConfig();
if(!p.sSelf) {
p.sSelf = new TransportManager;
qAddPostRoutine(Private::cleanupTransportManager);
}
return &p.sSelf;
return p.sSelf;
}
Transport* TransportManager::transportById(int id, bool def) const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment