brandingserver/bsserver/cbsstoragemanager.cpp
branchRCL_3
changeset 22 113b91e0a2ad
parent 21 cfd5c2994f10
--- a/brandingserver/bsserver/cbsstoragemanager.cpp	Tue Aug 31 15:31:29 2010 +0300
+++ b/brandingserver/bsserver/cbsstoragemanager.cpp	Wed Sep 01 12:27:45 2010 +0100
@@ -2,7 +2,7 @@
 * Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
+* under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
@@ -11,12 +11,11 @@
 *
 * Contributors:
 *
-* Description:   Stores element data and writes it to stream
+* Description:  Stores element data and writes it to stream
 *
 */
 
 
-
 #include <s32strm.h>
 #include <s32file.h>
 #include <f32file.h>
@@ -35,7 +34,7 @@
 #include "cbssession.h"
 #include "mbsupdater.h"
 //#include "importlogwriter.h"
-#include "DebugTrace.h"
+#include "debugtrace.h"
 
 
 // ======== MEMBER FUNCTIONS ========
@@ -267,7 +266,6 @@
                   langBuf.Length() + KDot().Length() * 3 + KMaxVersionLenght;
 	fileName = HBufC::NewLC( length );
     
-    if(fileName){
     TPtr file( fileName->Des() );
 
     // [application_id]\[brand_id]\[def_filename][language_id]
@@ -287,9 +285,11 @@
 	    file.Append( KDot() );
     	file.Append( versionBuffer );
     	}
-    	
-    	CleanupStack::Pop( fileName );      
-    }
+
+    if( fileName )
+    	{
+    	CleanupStack::Pop( fileName );
+    	}
     return fileName;
     }
 
@@ -900,6 +900,9 @@
 		CDir* directories = NULL;
 		
 		User::LeaveIfError( iFs.GetDir( driveAndPath, KEntryAttNormal, ESortByName, files, directories ) );
+
+		CleanupStack :: PushL (files);
+		CleanupStack :: PushL (directories);
 		
 		TInt count = files->Count();
 		for( TInt i = 0; i < count; i++ )
@@ -937,7 +940,10 @@
 				}
 			CleanupStack::PopAndDestroy( fullName );
 			}
-		CleanupStack::PopAndDestroy( nameWithDrive );
+		
+		CleanupStack :: PopAndDestroy (directories);
+		CleanupStack :: PopAndDestroy (files);
+		CleanupStack :: PopAndDestroy (nameWithDrive);
 		}
 	TRACE( T_LIT( "CBSStorageManager::CleanupFileL end") );
 	}