fotaapplication/fotaserver/src/fotaupdate.cpp
changeset 73 ae69c2e8bc34
parent 55 1c556dee8eb1
--- a/fotaapplication/fotaserver/src/fotaupdate.cpp	Tue Sep 28 17:53:08 2010 +0530
+++ b/fotaapplication/fotaserver/src/fotaupdate.cpp	Fri Oct 15 11:46:45 2010 +0530
@@ -16,7 +16,7 @@
  */
 
 // INCLUDE FILES
-#include <StringLoader.h>
+
 #include <centralrepository.h>
 #include <AknUtils.h>
 #include <AknBidiTextUtils.h> 
@@ -24,8 +24,6 @@
 #include <gdi.h>
 #include <fotaengine.h>
 #include <apgtask.h>
-#include <aknradiobuttonsettingpage.h> 
-#include <akntitle.h>
 #include <schtime.h>
 #include <csch_cli.h>
 #include <fotaengine.h>
@@ -65,6 +63,17 @@
 
     if (iProperty.Handle())
         iProperty.Close();
+    
+    if(iNotifier)
+        {
+         delete iNotifier;
+         iNotifier = NULL;
+        }
+    if(iNotifParams)
+        {
+         delete iNotifParams;
+         iNotifParams = NULL;
+        }            
 
     FLOG(_L("CFotaUpdate::~CFotaUpdate <<"));
     }
@@ -76,11 +85,24 @@
 CFotaUpdate* CFotaUpdate::NewL(CFotaServer* aServer)
     {
     CFotaUpdate* ao = new (ELeave) CFotaUpdate();
+	CleanupStack::PushL( ao );
+    ao->ConstructL();
     ao->iFotaServer = aServer;
+	CleanupStack::Pop(ao);
     return ao;
     }
 
 // ---------------------------------------------------------------------------
+// CFotaUpdate::ConstructL 
+// ---------------------------------------------------------------------------
+//
+
+void CFotaUpdate::ConstructL()
+    {
+    iNotifier = CFotaDownloadNotifHandler::NewL(this);
+    }
+
+// ---------------------------------------------------------------------------
 // CFotaUpdate::CheckUpdateResults
 // Checks if there is update result file available (meaning that update just
 // took place)
@@ -633,7 +655,7 @@
     iFotaServer->ServerCanShut(EFalse);
 
     if (iFotaServer->FullScreenDialog())
-        iFotaServer->FullScreenDialog()->Close();
+        iFotaServer->FullScreenDialog()->close();
 
     iNotifParams = CHbSymbianVariantMap::NewL();
 
@@ -644,7 +666,7 @@
     CHbSymbianVariant* dialogId = CHbSymbianVariant::NewL(&aDialogid,
             CHbSymbianVariant::EInt);
     iNotifParams->Add(*keyDialog, dialogId);
-    iNotifier = CFotaDownloadNotifHandler::NewL(this);
+    
 
     iNotifier->LaunchNotifierL(iNotifParams, aDialogid);