harvester/monitorplugins/fileplugin/src/FolderRenamer.cpp
changeset 40 910a23996aa0
parent 20 6dfc5f825351
child 60 79f826a55db2
child 63 e538444823de
--- a/harvester/monitorplugins/fileplugin/src/FolderRenamer.cpp	Wed Jul 14 07:57:22 2010 +0300
+++ b/harvester/monitorplugins/fileplugin/src/FolderRenamer.cpp	Fri Jul 23 10:03:59 2010 +0300
@@ -38,7 +38,9 @@
 CRenameItem::~CRenameItem()
 	{
 	delete iOldName;
+	iOldName = NULL;
 	delete iNewName;
+	iNewName = NULL;
 	iFileEvents.ResetAndDestroy();
 	}
 	
@@ -63,9 +65,14 @@
 	{
 	TMdsFSPStatus* event = NULL;
 	event = new TMdsFSPStatus(aEvent);
+	
 	if (event)
 		{
-		iFileEvents.Append(event);
+		if(iFileEvents.Append(event) != KErrNone)
+		    {
+            delete event;
+            event = NULL;
+		    }
 		}
 	}
 
@@ -157,7 +164,10 @@
 			iRenamedFolders.Remove(0);
 			TRAP_IGNORE(currItem->HandleFileEventsL(iCFileEventHandlerAO));
 			delete currItem;
+			currItem = NULL;
+			
 			SetNextRequest(ERenameStateIdle);
+			
 			if (iRenamedFolders.Count() == 0)
 				{
 				iIsRunning = EFalse;