photosgallery/viewframework/medialists/src/glxattributecontext.cpp
branchRCL_3
changeset 64 34937ec34dac
parent 60 5b3385a43d68
child 75 01504893d9cb
--- a/photosgallery/viewframework/medialists/src/glxattributecontext.cpp	Wed Sep 01 12:33:26 2010 +0100
+++ b/photosgallery/viewframework/medialists/src/glxattributecontext.cpp	Tue Sep 14 21:19:17 2010 +0300
@@ -172,20 +172,19 @@
             }
         }
     
-    
     // If the attribute request is for Thumbnail, Check if there is a match found.
     // And set the size and thumbnail quality
 	TIdentityRelation<TMPXAttribute> matchContent(&TMPXAttribute::MatchContentId);
 	TMPXAttribute tnAttr(KGlxMediaIdThumbnail, 0);
 	
-	if (iAttributes.Find(tnAttr, matchContent) != KErrNotFound) 
+	if (aAttributes.Find(tnAttr, matchContent) != KErrNotFound) 
 		{
 		// Allocate CMPXAttributeSpecs
 		CMPXAttributeSpecs* attributeSpecs = CMPXAttributeSpecs::NewL();
 		CleanupStack::PushL(attributeSpecs);
 		
-	attributeSpecs->SetTObjectValueL(
-	   TMPXAttribute( KGlxMediaIdThumbnail,
+		attributeSpecs->SetTObjectValueL(
+	    TMPXAttribute( KGlxMediaIdThumbnail,
 					   KGlxAttribSpecThumbnailSize ), 
 					   TSize(iDefaultSpecSize.iWidth,iDefaultSpecSize.iHeight) );
 		
@@ -193,11 +192,16 @@
 		   TMPXAttribute( KGlxMediaIdThumbnail,
 					   KGlxAttribSpecThumbnailQualityOverSpeed ), ETrue );
 		
+		// Memory leak guard check
+		if (aDetailedSpecs)
+		    {
+            delete aDetailedSpecs;
+            aDetailedSpecs = NULL;
+		    }
 		aDetailedSpecs = attributeSpecs;
 		
 		// Pop from stack
 		CleanupStack::Pop(attributeSpecs);
-		
 		}
 
     // If an error was found, return KErrGeneral