From 4c8e552d147a2258cc693e8a020a11eb98aaa0ab Mon Sep 17 00:00:00 2001 From: Till Adam Date: Wed, 30 Jul 2003 17:10:24 +0000 Subject: [PATCH] This prevents the following crash: - create new imap account - kernel does cleanupImapFolders - which creates the account folder and sets it to noContent - it then closes the folder - close in kmfoldermbox calls unlock - that does assert(stream), there is no stream, because there is no content - BOOM svn path=/trunk/kdepim/; revision=240056 --- kmfoldermbox.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/kmfoldermbox.cpp b/kmfoldermbox.cpp index 0d7391fee..38290e9b6 100644 --- a/kmfoldermbox.cpp +++ b/kmfoldermbox.cpp @@ -242,15 +242,16 @@ void KMFolderMbox::close(bool aForced) writeConfig(); } - unlock(); - mMsgList.clear(TRUE); + if (!noContent()) { + unlock(); + mMsgList.clear(TRUE); - if (mStream) fclose(mStream); + if (mStream) fclose(mStream); if (mIndexStream) { - fclose(mIndexStream); - updateIndexStreamPtr(TRUE); + fclose(mIndexStream); + updateIndexStreamPtr(TRUE); } - + } mOpenCount = 0; mStream = 0; mIndexStream = 0;