--- a/commands/localdrive/localdrive.cpp Mon Sep 20 16:46:34 2010 +0100
+++ b/commands/localdrive/localdrive.cpp Wed Oct 13 12:41:05 2010 +0100
@@ -226,7 +226,12 @@
if (err == KErrNone)
{
TPckg<TLocalDriveCapsV2> capsBuf(iCaps);
- LeaveIfErr(iDrive.Caps(capsBuf), _L("Opened drive %d but couldn't read caps"), aDrive);
+ err = iDrive.Caps(capsBuf);
+ if (err)
+ {
+ iDrive.Close();
+ if (aLeaveOnConnectErr) LeaveIfErr(err, _L("Opened drive %d but couldn't read caps"), aDrive);
+ }
}
else if (aLeaveOnConnectErr)
{