locationmanager/geotagger/src/cinternalgeotagger.cpp
changeset 52 40db28bb26b8
parent 45 a93990e5815e
child 56 fd6cce931a8a
--- a/locationmanager/geotagger/src/cinternalgeotagger.cpp	Wed Aug 18 10:12:07 2010 +0300
+++ b/locationmanager/geotagger/src/cinternalgeotagger.cpp	Thu Sep 02 20:52:02 2010 +0300
@@ -117,9 +117,11 @@
 	   TRAP_IGNORE(
         iRevGeocoderPlugin = reinterpret_cast<CReverseGeoCoderPlugin*>(
            REComSession::CreateImplementationL(KReverseGeoCodeUid, iDtorKey));)
-
-        iRevGeocoderPlugin->AddObserverL(*this); 
-
+           	
+        if( iRevGeocoderPlugin )
+			{
+            iRevGeocoderPlugin->AddObserverL(*this); 
+			}
 
 #endif //LOC_REVERSEGEOCODE
 
@@ -145,18 +147,21 @@
 		iRelationQuery->RemoveObserver(*this);
 		iRelationQuery->Cancel();
 		delete iRelationQuery;
+		iRelationQuery = NULL;
 		}
 	if(iLocationQuery)
 		{
 		iLocationQuery->RemoveObserver(*this);
 		iLocationQuery->Cancel();
 		delete iLocationQuery;
+		iLocationQuery = NULL;
 		}
 	if(iTagQuery)
 		{
 		iTagQuery->RemoveObserver(*this);
 		iTagQuery->Cancel();
 		delete iTagQuery;
+		iTagQuery = NULL;
 		}	
 #ifdef LOC_REVERSEGEOCODE
     delete iTagCreator;
@@ -168,7 +173,9 @@
     if(iMdeSessionOwnFlag)
         {
     	delete iMdeSession;
+    	iMdeSession = NULL; 
         delete iASW;
+        iASW = NULL;
         }
     LOG("CInternalGeoTagger::~CInternalGeoTagger ,end");
     }