--- a/filemanager/GFLM/src/CGflmFileRecognizer.cpp Tue Apr 27 16:25:17 2010 +0300
+++ b/filemanager/GFLM/src/CGflmFileRecognizer.cpp Tue May 11 16:01:48 2010 +0300
@@ -96,7 +96,9 @@
RResourceFile& aResFile,
TInt aResId,
RPointerArray< CExtMimePair >& aPairs )
- {
+ {
+ TCleanupItem cleanupItem( ResetAndDestroyExtMimePairs, &aPairs );
+ CleanupStack::PushL( cleanupItem );
// read the pairs
HBufC8* resData = aResFile.AllocReadLC( aResId );
TResourceReader reader;
@@ -115,6 +117,7 @@
CleanupStack::Pop( pair );
}
CleanupStack::PopAndDestroy( resData );
+ CleanupStack::Pop( &aPairs );
}
// -----------------------------------------------------------------------------
@@ -320,6 +323,21 @@
return TPtrC( KNullDesC );
}
+
+// -----------------------------------------------------------------------------
+// CGflmFileRecognizer::ResetAndDestroyExtMimePairs( )
+//
+// -----------------------------------------------------------------------------
+//
+void CGflmFileRecognizer::ResetAndDestroyExtMimePairs( TAny* aPtr )
+ {
+ RPointerArray< CExtMimePair >* extMimePairs =
+ static_cast< RPointerArray< CExtMimePair >* >( aPtr );
+ extMimePairs->ResetAndDestroy();
+ extMimePairs->Close();
+ }
+
+
// -----------------------------------------------------------------------------
// CGflmFileRecognizer::FlushCache( )
//