email/imap4mtm/imapsyncmanager/src/cimapfolder.cpp
changeset 40 224522e33db9
parent 23 238255e8b033
child 55 5b3b2fa8c3ec
--- a/email/imap4mtm/imapsyncmanager/src/cimapfolder.cpp	Tue Jun 29 23:42:47 2010 +0530
+++ b/email/imap4mtm/imapsyncmanager/src/cimapfolder.cpp	Tue Jul 06 22:50:16 2010 +0530
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -96,6 +96,12 @@
 	iMatchingMessageIds.Reset();
 	iDeletedMessageIds.Reset();
 	iMissingMessageIds.Reset();
+	
+	if(iCachedEntryData)
+		{
+	    iCachedEntryData->Close();
+		}
+		
 	delete iSelection;
 	iFolderIndex->Reset();
 	iMessageFlagInfoArray.Reset();
@@ -1121,9 +1127,12 @@
 	SetEntryL(aFolder);
 	GetChildrenL(*aChildren);
 
+	if(iCachedEntryData)
+	    {
+        iCachedEntryData->Close();
+	    }
 	delete iCachedEntryData;
 	iCachedEntryData = NULL;
-
 	iCachedEntryData = new(ELeave) RArray<TMsvCacheData>(5);
 
 	// Go through them, checking to see if they're messages and removing ones that aren't