Fixing some smoketests and a memory leak in CCommandBase. PDK_4.0.a
authorTom Sutcliffe <thomas.sutcliffe@accenture.com>
Wed, 22 Sep 2010 17:40:33 +0100
changeset 80 ed15378514e0
parent 79 f3d01c9dd099
Fixing some smoketests and a memory leak in CCommandBase.
commands/drvinfo/drvinfo.cif
commands/uidinfo/uidinfo.cif
libraries/iosrv/client/command_base.cpp
--- a/commands/drvinfo/drvinfo.cif	Wed Sep 22 10:56:39 2010 +0100
+++ b/commands/drvinfo/drvinfo.cif	Wed Sep 22 17:40:33 2010 +0100
@@ -34,4 +34,4 @@
 
 ==smoke-test
 
-drvinfo $Quiet
+drvinfo $Silent # Warnings about missing drives are not important
--- a/commands/uidinfo/uidinfo.cif	Wed Sep 22 10:56:39 2010 +0100
+++ b/commands/uidinfo/uidinfo.cif	Wed Sep 22 17:40:33 2010 +0100
@@ -34,5 +34,6 @@
 
 ==smoke-test
 
-uidinfo 0x100041af | export -s RESULT
-var RESULT == "0x100041af EKern.exe^r^n" || $Error
+# Use the fileserver as it's guaranteed to be there
+uidinfo 0x100039e3 | export -s RESULT
+var RESULT == "0x100039e3 efile.exe^r^n" || var RESULT == "0x100039e3 EFile.exe^r^n" || $Error # Emulator capitalises differently, sigh
--- a/libraries/iosrv/client/command_base.cpp	Wed Sep 22 10:56:39 2010 +0100
+++ b/libraries/iosrv/client/command_base.cpp	Wed Sep 22 17:40:33 2010 +0100
@@ -416,6 +416,7 @@
 			{
 			*(TInt*)iValue = value;
 			}
+		delete aString; // Because the command class knows nothing about how enums are converted from HBufCs in this case, it cannot be responsible for deleting the HBufC like it would be for a normal string argument. So we delete it here.
 		iIsSet = ETrue;
 		}
 	else // string
@@ -2392,8 +2393,8 @@
 			case KValueTypeEnum:
 				{
 				HBufC* string = ReadStringLC(aLex, EDisallowLeadingHyphen);
-				aValue.SetValueL(string);	
-				CleanupStack::PopAndDestroy(string);
+				aValue.SetValueL(string);
+				CleanupStack::Pop(string); // SetValueL takes ownership
 				break;
 				}
 			default: