contentmgmt/referencedrmagent/tcaf/source/Contentstep.cpp
changeset 108 ca9a0fc2f082
parent 102 deec7e509f66
--- a/contentmgmt/referencedrmagent/tcaf/source/Contentstep.cpp	Wed Oct 06 11:09:48 2010 +0530
+++ b/contentmgmt/referencedrmagent/tcaf/source/Contentstep.cpp	Sat Oct 30 16:29:23 2010 +0530
@@ -93,8 +93,10 @@
 		{
 		RFile file;
 		file.Open(iParent.Fs(), uri, EFileShareReadersOnly);		
-		content = CContent::NewLC(file);
-		file.Close();
+		CleanupClosePushL(file);
+		content = CContent::NewL(file);
+		CleanupStack::PopAndDestroy(&file);
+		CleanupStack::PushL(content);
 		value = expectedValue+1;
 		User::LeaveIfError(content->GetAttribute(attribute, value, uniqueId));
 		if(expectedValue != value)
@@ -195,8 +197,10 @@
 		{
 		RFile file;
 		file.Open(iParent.Fs(), uri, EFileShareReadersOnly);		
-		content = CContent::NewLC(file);
-		file.Close(); 		
+		CleanupClosePushL(file);
+		content = CContent::NewL(file);
+		CleanupStack::PopAndDestroy(&file);
+		CleanupStack::PushL(content);
 	    		
 		CleanupClosePushL(attributeSet);
 		attributeSet.AddL(attribute1);
@@ -301,8 +305,10 @@
 	   	{
 		RFile file;
 		file.Open(iParent.Fs(), uri, EFileShareReadersOnly);		
-		content = CContent::NewLC(file);
-		file.Close(); 		
+		CleanupClosePushL(file);
+		content = CContent::NewL(file);
+		CleanupStack::PopAndDestroy(&file);
+		CleanupStack::PushL(content);		
 
 		result = content->GetStringAttribute(attribute, value, uniqueId);
 		if(result != expectedResult)
@@ -420,8 +426,10 @@
 		{	
 		RFile file;
 		file.Open(iParent.Fs(), uri, EFileShareReadersOnly);		
-		content = CContent::NewLC(file);
-		file.Close(); 		
+		CleanupClosePushL(file);
+		content = CContent::NewL(file);
+		CleanupStack::PopAndDestroy(&file);
+		CleanupStack::PushL(content);	
 
 		CleanupClosePushL(attributeSet);
 		attributeSet.AddL(attribute1);