[Bug 137302] crash when deleting imap and creating pop account in one step

Will Stephenson <[email protected]>
Newsgroups gmane.comp.kde.devel.kmail
Message-ID <[email protected]>
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=137302         
wstephenson kde org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From wstephenson kde org  2007-03-22 15:10 -------
SVN commit 645389 by wstephens:

When deleting an account, there may be jobs live on that account that aren't automatically cleaned up.  Make them safe in places where they lookup the account.
BUG: 137302


 M  +30 -0     imapjob.cpp  


--- branches/KDE/3.5/kdepim/kmail/imapjob.cpp #645388:645389
 @ -502,6 +502,12  @
 void ImapJob::slotPutMessageDataReq( KIO::Job *job, QByteArray &data )
 {
   KMAcctImap *account = static_cast<KMFolderImap*>(mDestFolder->storage())->account();
+  if ( !account )
+  {
+    emit finished();
+    deleteLater();
+    return;
+  }
   ImapAccountBase::JobIterator it = account->findJob( job );
   if ( it == account->jobsEnd() ) return;
 
 @ -522,6 +528,12  @
 void ImapJob::slotPutMessageResult( KIO::Job *job )
 {
   KMAcctImap *account = static_cast<KMFolderImap*>(mDestFolder->storage())->account();
+  if ( !account )
+  {
+    emit finished();
+    deleteLater();
+    return;
+  }
   ImapAccountBase::JobIterator it = account->findJob( job );
   if ( it == account->jobsEnd() ) return;
   bool deleteMe = false;
 @ -562,6 +574,12  @
 {
   KMFolderImap * imapFolder = static_cast<KMFolderImap*>(mDestFolder->storage());
   KMAcctImap *account = imapFolder->account();
+  if ( !account )
+  {
+    emit finished();
+    deleteLater();
+    return;
+  }
   ImapAccountBase::JobIterator it = account->findJob( job );
   if ( it == account->jobsEnd() ) return;
 
 @ -595,6 +613,12  @
 {
   KMFolderImap * imapFolder = static_cast<KMFolderImap*>(mDestFolder->storage());
   KMAcctImap *account = imapFolder->account();
+  if ( !account )
+  {
+    emit finished();
+    deleteLater();
+    return;
+  }
   ImapAccountBase::JobIterator it = account->findJob( job );
   if ( it == account->jobsEnd() ) return;
 
 @ -613,6 +637,12  @
 void ImapJob::slotCopyMessageResult( KIO::Job *job )
 {
   KMAcctImap *account = static_cast<KMFolderImap*>(mDestFolder->storage())->account();
+  if ( !account )
+  {
+    emit finished();
+    deleteLater();
+    return;
+  }
   ImapAccountBase::JobIterator it = account->findJob( job );
   if ( it == account->jobsEnd() ) return;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.