diff -r 7e0eff37aedb -r e78c61e77b1a profilesservices/MediaFileList/Src/mediafilehandler.cpp --- a/profilesservices/MediaFileList/Src/mediafilehandler.cpp Wed Sep 01 12:20:44 2010 +0100 +++ b/profilesservices/MediaFileList/Src/mediafilehandler.cpp Tue Sep 14 21:51:42 2010 +0300 @@ -2886,6 +2886,7 @@ CSearchList::~CSearchList() { iList.ResetAndDestroy(); + iList.Close(); delete iDriveUtil; } @@ -3001,7 +3002,7 @@ TInt count = aQuery->Count( 0 ); for( int i = 0; i< count; i++ ) { - CSearchListItem* item = CSearchListItem::NewL(); + CSearchListItem* item = CSearchListItem::NewLC(); error = aQuery->RomFileItem( item, i ); if ( error == KErrNone ) { @@ -3010,7 +3011,16 @@ if ( rt != KErrNotFound ) { iList.AppendL( item ); + CleanupStack::Pop( item ); } + else + { + CleanupStack::PopAndDestroy( item ); + } + } + else + { + CleanupStack::PopAndDestroy( item ); } } } @@ -3030,7 +3040,7 @@ TInt count = aQuery->Count( 1 ); for( int i = 0; i< count; i++ ) { - CSearchListItem* item = CSearchListItem::NewL(); + CSearchListItem* item = CSearchListItem::NewLC(); error = aQuery->RomVedioItem( item, i ); if ( error == KErrNone ) { @@ -3039,7 +3049,16 @@ if ( rt != KErrNotFound ) { iList.AppendL( item ); + CleanupStack::Pop( item ); } + else + { + CleanupStack::PopAndDestroy( item ); + } + } + else + { + CleanupStack::PopAndDestroy( item ); } } } @@ -3163,11 +3182,16 @@ count = aRomList->Count( 0 ); for ( TInt i=0; i< count; i++ ) { - CSearchListItem* item = CSearchListItem::NewL(); + CSearchListItem* item = CSearchListItem::NewLC(); error = aRomList->RomFileItem( item, i ); if ( error == KErrNone ) { iList.AppendL( item ); + CleanupStack::Pop( item ); + } + else + { + CleanupStack::PopAndDestroy( item ); } } } @@ -3176,11 +3200,16 @@ count = aRomList->Count( 1 ); for (TInt i = 0; i < count; i++) { - CSearchListItem* item = CSearchListItem::NewL(); + CSearchListItem* item = CSearchListItem::NewLC(); error = aRomList->RomVedioItem(item, i); if (error == KErrNone) { iList.AppendL(item); + CleanupStack::Pop( item ); + } + else + { + CleanupStack::PopAndDestroy( item ); } } }