Fixed crash on exit when kontact is uploading messages. Full details

(gdb, valgrind) at https://intevation.de/roundup/kolab/issue348, but basically
we don't want to emit folderComplete() when the dtor calls killAllJobs.

This fixes #86117 too.

svn path=/trunk/kdepim/; revision=349008
wilder-work
David Faure 22 years ago
parent af1a96f916
commit fa0ad76a57
  1. 24
      kmacctcachedimap.cpp
  2. 1
      kmacctcachedimap.h

@ -69,7 +69,7 @@ KMAcctCachedImap::KMAcctCachedImap( KMAcctMgr* aOwner,
//-----------------------------------------------------------------------------
KMAcctCachedImap::~KMAcctCachedImap()
{
killAllJobs( true );
killAllJobsInternal( true );
}
@ -123,6 +123,20 @@ void KMAcctCachedImap::setAutoExpunge( bool /*aAutoExpunge*/ )
void KMAcctCachedImap::killAllJobs( bool disconnectSlave )
{
//kdDebug(5006) << "killAllJobs: disconnectSlave=" << disconnectSlave << " " << mapJobData.count() << " jobs in map." << endl;
QValueList<KMFolderCachedImap*> folderList = killAllJobsInternal( disconnectSlave );
for( QValueList<KMFolderCachedImap*>::Iterator it = folderList.begin(); it != folderList.end(); ++it ) {
KMFolderCachedImap *fld = *it;
fld->resetSyncState();
fld->setContentState(KMFolderCachedImap::imapNoInformation);
fld->setSubfolderState(KMFolderCachedImap::imapNoInformation);
fld->sendFolderComplete(FALSE);
}
}
//-----------------------------------------------------------------------------
// Common between killAllJobs and the destructor - which shouldn't call sendFolderComplete
QValueList<KMFolderCachedImap*> KMAcctCachedImap::killAllJobsInternal( bool disconnectSlave )
{
// Make list of folders to reset. This must be done last, since folderComplete
// can trigger the next queued mail check already.
QValueList<KMFolderCachedImap*> folderList;
@ -147,13 +161,7 @@ void KMAcctCachedImap::killAllJobs( bool disconnectSlave )
KIO::Scheduler::disconnectSlave( slave() );
mSlave = 0;
}
for( QValueList<KMFolderCachedImap*>::Iterator it = folderList.begin(); it != folderList.end(); ++it ) {
KMFolderCachedImap *fld = *it;
fld->resetSyncState();
fld->setContentState(KMFolderCachedImap::imapNoInformation);
fld->setSubfolderState(KMFolderCachedImap::imapNoInformation);
fld->sendFolderComplete(FALSE);
}
return folderList;
}
//-----------------------------------------------------------------------------

@ -188,6 +188,7 @@ protected slots:
virtual void slotCheckQueuedFolders();
private:
QValueList<KMFolderCachedImap*> killAllJobsInternal( bool disconnectSlave );
void processNewMail( KMFolderCachedImap* folder, bool interactive, bool recurse );
private:

Loading…
Cancel
Save