locationmanager/geoconverter/src/cgeoconverter.cpp
changeset 45 a93990e5815e
parent 36 aa5a574040a4
child 52 40db28bb26b8
--- a/locationmanager/geoconverter/src/cgeoconverter.cpp	Tue Jul 06 14:44:37 2010 +0300
+++ b/locationmanager/geoconverter/src/cgeoconverter.cpp	Wed Aug 18 10:12:07 2010 +0300
@@ -31,7 +31,7 @@
     CGeoConverter* self = new( ELeave ) CGeoConverter( aObserver );
     CleanupStack::PushL( self );
     self->ConstructL();
-    CleanupStack::Pop();
+    CleanupStack::Pop(); // self
     return self;
     }
 
@@ -135,12 +135,12 @@
     
     //Set mobile country code
     TLex lexer( aNetworkInfo.iCountryCode );
-    TUint countryCode;
+    TUint countryCode = 0;
     
     User::LeaveIfError( lexer.Val( countryCode, EDecimal) );
     //Set mobile network code
     lexer = aNetworkInfo.iNetworkId;
-    TUint networkCode;
+    TUint networkCode = 0;
     User::LeaveIfError( lexer.Val( networkCode, EDecimal) );
     LOG1("Network mode - %d", aNetworkInfo.iMode);
     CLbsAreaInfoBase* areaInfoBase = NULL;
@@ -185,14 +185,18 @@
         default:
             LOG("Unknown network mode");
             User::Leave(KErrNotSupported);
-            break;
         }
     //Add the cell information to the location info class. This class
     //would be sent to the Location Monitor server that would perform the
     //requested conversion and update the position estimate
     if(areaInfoBase != NULL) // self check
         {
+        // reset previous one.. to clear the local info.
+        iLocInfo->ResetAreaInfo(CLbsLocationInfo::ELbsAreaInfoAll);
         iLocInfo->AddAreaInfoL( areaInfoBase ); 
+        //ownership is transferred.
+        iWcdmaCellInfo = NULL;
+        iGsmCellInfo = NULL;
         //Request conversion of GSM cell information to corresponding coordinate information
         iLocConverter->ConvertLocationInfoL( *iLocInfo, ELbsConversionSilent, 
                                                 ELbsConversionOutputPosition  );