appinstaller/AppMngr2/Sisx/src/appmngr2sisxappinfo.cpp
branchRCL_3
changeset 18 3ba40be8e484
parent 15 51c0f5edf5ef
child 19 7ca52d38f8c3
--- a/appinstaller/AppMngr2/Sisx/src/appmngr2sisxappinfo.cpp	Fri Feb 19 22:57:02 2010 +0200
+++ b/appinstaller/AppMngr2/Sisx/src/appmngr2sisxappinfo.cpp	Fri Mar 12 15:43:14 2010 +0200
@@ -294,11 +294,13 @@
             iIsDRMProtected = TAppMngr2DRMUtils::IsDRMProtected( *fileName );
             if( iIsDRMProtected )
                 {
-                FLOG( "CAppMngr2SisxAppInfo::ConstructL, protected file %S", fileName );
+                FLOG( "CAppMngr2SisxAppInfo::ConstructL, iProtectedFile %S", fileName );
                 iProtectedFile = fileName;  // takes ownership
                 files.Remove( fileIndex );
                 iIsRightsObjectMissingOrExpired =
                     TAppMngr2DRMUtils::IsDRMRightsObjectExpiredOrMissingL( *fileName );
+                FLOG( "CAppMngr2SisxAppInfo::ConstructL, iIsRightsObjectMissingOrExpired %d",
+                        iIsRightsObjectMissingOrExpired );
                 }
             }
         CleanupStack::PopAndDestroy( &files );
@@ -326,12 +328,21 @@
     FLOG( "CAppMngr2SisxAppInfo::ShowDetailsL, isDRM %d, noRightsObj %d, CertCount %d",
             iIsDRMProtected, iIsRightsObjectMissingOrExpired, iCertificates.Count() );
 
+    RFile fileHandle;
+    TInt fileOpenError = KErrNone;
     if( iIsDRMProtected && !iIsRightsObjectMissingOrExpired )
         {
-        RFile fileHandle;
-        TInt err = fileHandle.Open( iFs, *iProtectedFile, EFileShareReadersOnly | EFileRead );
-        CleanupClosePushL( fileHandle );
+        FLOG( "CAppMngr2SisxAppInfo::ShowDetailsL, iProtecteFile %S", iProtectedFile );
+        fileOpenError = fileHandle.Open( iFs, *iProtectedFile, EFileShareReadersOnly | EFileRead );
+        FLOG( "CAppMngr2SisxAppInfo::ShowDetailsL, fileOpenError %d", fileOpenError );
+        if( !fileOpenError )
+            {
+            CleanupClosePushL( fileHandle );
+            }
+        }
 
+    if( iIsDRMProtected && !iIsRightsObjectMissingOrExpired && !fileOpenError )
+        {
         if( iCertificates.Count() )
             {
             details->ExecuteLD( *iterator, iCertificates, fileHandle );
@@ -340,8 +351,6 @@
             {
             details->ExecuteLD( *iterator, fileHandle );
             }
-
-        CleanupStack::PopAndDestroy( &fileHandle );
         }
     else
         {
@@ -355,6 +364,11 @@
             }
         }
 
+    if( !fileOpenError )
+        {
+        CleanupStack::PopAndDestroy( &fileHandle );
+        }
+
     CleanupStack::PopAndDestroy( iterator );
     }