[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/kmail
From:       Martin Koller <kollix () aon ! at>
Date:       2009-08-31 21:48:07
Message-ID: 1251755287.992944.24132.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1017922 by mkoller:

BUG: 196053

Fix crash in precommand execution (hopefully).
The crash was probably due to the eventloop object got destroyed in its own loop.


 M  +5 -11     kmaccount.cpp  


--- trunk/KDE/kdepim/kmail/kmaccount.cpp #1017921:1017922
@@ -395,7 +395,6 @@
           SLOT(precommandExited(bool)));
 
   kDebug() << "Running precommand" << precommand;
-  mPrecommandEventLoop = new QEventLoop();
   if ( !precommandProcess.start() )
     return false;
 
@@ -403,9 +402,10 @@
   // the precommand is running (which may take a while).
   // The exec call will block until the event loop is exited, which happens in
   // precommandExited().
-  if ( mPrecommandEventLoop ) { // yes it can be 0 due to races with precommandProcess.start()
-    mPrecommandEventLoop->exec();
-  }
+  mPrecommandEventLoop = new QEventLoop();
+  mPrecommandEventLoop->exec();
+  delete mPrecommandEventLoop;
+  mPrecommandEventLoop = 0;
 
   return mPrecommandSuccess;
 }
@@ -415,16 +415,10 @@
 {
   Q_ASSERT( mPrecommandEventLoop != 0 );
   mPrecommandSuccess = success;
-
-  // Exit and delete the event loop. This makes sure the execution continues
-  // in runPrecommand(), where the event loop was entered.
   mPrecommandEventLoop->exit();
-
-  // Use deleteLater, because we are called inside of this very eventloop
-  mPrecommandEventLoop->deleteLater();
-  mPrecommandEventLoop = 0;
 }
 
+//-----------------------------------------------------------------------------
 void KMAccount::slotIdentitiesChanged()
 {
   // Fall back to the default identity if the one used currently is invalid
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic