harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp
changeset 41 2290317b9ec5
parent 21 50bf9db68373
--- a/harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp	Mon May 03 12:55:01 2010 +0300
+++ b/harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp	Fri May 14 16:38:28 2010 +0300
@@ -113,8 +113,7 @@
 	TUint32 hdMediaId( 0 );
     hdMediaId = iMountTask->GetInternalDriveMediaId();
     
-    const TInt count( medias.Count() );
-    for ( TInt i = 0; i < count; i++ )
+    for( TInt i = medias.Count() - 1; i >=0; i-- )
     	{
     	TRAP_IGNORE( iMdEClient->GetMediaL( medias[i].iMediaId, driveLetter, presentState ) );
     	
@@ -265,6 +264,11 @@
 	            mountData->iMountType = TMountData::EUnmount;
 	            iMountTask->StartUnmount( *mountData );
             	}
+            else
+                {
+                delete mountData;
+                mountData = NULL;
+                }
             }
         break;
         
@@ -344,9 +348,11 @@
                 }
             
             iFs.Drive( driveInfo, i );
-            if ( ((driveInfo.iDriveAtt & KDriveAttRemovable) || (driveInfo.iDriveAtt & KDriveAttLogicallyRemovable) ||
-                   (driveInfo.iType == EMediaHardDisk && driveStatus & DriveInfo::EDriveInternal) ) &&
-                   (driveInfo.iType != EMediaNotPresent) )
+            if( ( (driveStatus & DriveInfo::EDriveRemovable) ||
+                   (driveInfo.iType == EMediaHardDisk && driveStatus & DriveInfo::EDriveInternal) ||
+                   (driveInfo.iDriveAtt & KDriveAttLogicallyRemovable) ||
+                   (driveInfo.iDriveAtt & KDriveAttRemovable) ) &&
+                (driveInfo.iType != EMediaNotPresent) )
                 {
                 count++; // DEBUG INFO