locationmanager/locationtrail/src/ctracklog.cpp
branchRCL_3
changeset 19 b73252188534
parent 8 50de4d668bb6
--- a/locationmanager/locationtrail/src/ctracklog.cpp	Thu Jul 15 19:07:24 2010 +0300
+++ b/locationmanager/locationtrail/src/ctracklog.cpp	Thu Aug 19 10:20:41 2010 +0300
@@ -68,6 +68,7 @@
 EXPORT_C CTrackLog::~CTrackLog()
 	{
 	delete iGpxConverter;
+	iGpxConverter = NULL;
 	iFs.Close();
 	}
 
@@ -201,6 +202,7 @@
 				if ( err == KErrNone )
 					{
 					delete lastCoords;
+					lastCoords = NULL;
 					lastCoords = new TCoordinate( aTrailItem.iLocationData.iPosition );
 					iBoundaries->distance += distance;
 					}
@@ -221,6 +223,8 @@
 	RFile64 file;
 	RFileWriteStream writer;
 	
+	CleanupClosePushL( writer );
+	
 	TInt err;
 	err = file.Open( iFs, iTmpFileName, EFileRead );
 	if ( err != KErrNone )
@@ -247,8 +251,6 @@
 		writer.Sink()->SeekL( MStreamBuf::EWrite, TStreamPos( endpos ));
 		}
 	
-	CleanupClosePushL( writer );
-	
 	TInt count = iTrackLogItemArray.Count();
 	
 	for( TInt i = 0; i < count; i++ )
@@ -306,7 +308,9 @@
 			}
 		}
 	delete filename;
+	filename = NULL;
 	delete files;
+	files = NULL;
 	}
 
 void CTrackLog::ReadCenRepValueL(TInt aKey, TInt& aValue)