locationmanager/locationtrail/src/cgpxconverterao.cpp
changeset 21 50bf9db68373
parent 1 acef663c1218
child 25 8e4539ab1889
--- a/locationmanager/locationtrail/src/cgpxconverterao.cpp	Fri Mar 19 09:38:01 2010 +0200
+++ b/locationmanager/locationtrail/src/cgpxconverterao.cpp	Fri Apr 16 15:23:55 2010 +0300
@@ -70,6 +70,12 @@
     
     iObservers.Reset();
     
+    iFileQueue.ResetAndDestroy();
+    iFileQueue.Close();
+    
+    iBoundQueue.ResetAndDestroy();
+    iBoundQueue.Close();
+    
     delete iWriteBuf;
     delete iFormatBuf;
     }
@@ -105,8 +111,10 @@
 	{
 	LOG("CGpxConverterAO::AddToQueueL");
 	TFileName *filename = new (ELeave) TFileName(aFileName);
-	iFileQueue.Append(filename);
-	iBoundQueue.Append( aBoundaries );
+	CleanupStack::PushL( filename );
+	iFileQueue.AppendL( filename );
+	CleanupStack::Pop( filename );
+	iBoundQueue.AppendL( aBoundaries );
 	
 	if ( iState == EIdle )
 		{
@@ -275,8 +283,7 @@
 				distance = iBoundaries->distance;
 				}
 			
-			TInt count = iObservers.Count();
-			for( TInt i = 0; i < count; i++ )
+			for( TInt i = iObservers.Count() - 1; i >=0; i-- )
 				{
 				iObservers[i]->GpxFileCreated( iGpxPath, iTagId, distance, iStartTime, iEndTime );
 				}