idlehomescreen/widgetmanager/src/wminstaller.cpp
branchRCL_3
changeset 34 d05a55b217df
parent 30 b8fae6b8a148
--- a/idlehomescreen/widgetmanager/src/wminstaller.cpp	Wed Mar 31 21:17:19 2010 +0300
+++ b/idlehomescreen/widgetmanager/src/wminstaller.cpp	Wed Apr 14 15:47:59 2010 +0300
@@ -119,19 +119,19 @@
 void CWmInstaller::RunL()
     {
     // if error has occurred, stop uninstallation animation.
-    if ( iStatus.Int() != KErrNone )
+    CWmWidgetData* widget = 
+            iWmPlugin.GetUninstalledWidgetByUid( iUid );
+    if ( widget )
         {
-        CWmWidgetData* widget = 
-                iWmPlugin.GetUninstalledWidgetByUid( iUid );
-        if ( widget )
-            {
-            widget->StopUninstallAnimationL();
-            }
-        
-        // display error note
+        widget->StopUninstallAnimation();
+        }
+
+    if ( KErrNone !=  iStatus.Int() )
+        {
+        // display error note incase of error
         CEikonEnv::Static()->HandleError( iStatus.Int() );
         }
-    
+
     // close SWI session
     if ( iIdle && iIdle->IsActive() )
         {
@@ -163,7 +163,14 @@
 // ---------------------------------------------------------
 //
 TInt CWmInstaller::RunError(TInt /*aError*/)
-    {   
+    {
+     // if error has occurred, stop uninstallation animation.
+    CWmWidgetData* widget = 
+            iWmPlugin.GetUninstalledWidgetByUid( iUid );
+    if ( widget )
+        {
+        widget->StopUninstallAnimation();
+        }
     // close SWI session
     if ( iIdle && iIdle->IsActive() )
         {
@@ -193,6 +200,9 @@
         {
         delete iMime;
         iMime = NULL;
+        CloseSwiSession( this );
+        
+        // re-open session to swi server
         User::LeaveIfError( iInstaller.Connect() );
         iMime = ( ( aData->WrtType() == CWmWidgetData::EWgt ) ?
             KCWrtMime().AllocL() : KWrtMime().AllocL() );