diff -r 5b3385a43d68 -r 34937ec34dac photosgallery/viewframework/medialists/src/glxattributecontext.cpp --- 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 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