imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailimagedecoderv3.cpp
branchRCL_3
changeset 24 f0aa341a25bf
parent 20 ffb2d5dd62e9
child 28 ff2fb7658ff7
--- a/imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailimagedecoderv3.cpp	Tue May 25 13:01:47 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailimagedecoderv3.cpp	Wed Jun 09 10:01:32 2010 +0300
@@ -39,8 +39,8 @@
 // C++ default constructor can NOT contain any code, that might leave.
 // ---------------------------------------------------------------------------
 //
-CThumbnailImageDecoderv3::CThumbnailImageDecoderv3( RFs& aFs ): CActive(
-    EPriorityStandard ), iFs( aFs )
+CThumbnailImageDecoderv3::CThumbnailImageDecoderv3( RFs& aFs ): 
+    CActive(EPriorityStandard ), iBitmap( NULL ), iFs( aFs ), iBuffer( NULL )
     {
     CActiveScheduler::Add( this );
     }
@@ -158,8 +158,14 @@
 void CThumbnailImageDecoderv3::Release()
     {
     Cancel();
+    
     delete iDecoder;
     iDecoder = NULL;
+    
+    delete iBitmap;
+    iBitmap = NULL;
+    delete iBuffer; // we own the buffer
+    iBuffer = NULL;
     }
 
 
@@ -175,6 +181,11 @@
         delete iDecoder;
         iDecoder = NULL;
         }
+    
+    delete iBitmap;
+    iBitmap = NULL;
+    delete iBuffer; // we own the buffer
+    iBuffer = NULL;
     }
 
 
@@ -188,8 +199,9 @@
     iObserver->ThumbnailProviderReady( iStatus.Int(), iBitmap, iOriginalSize, EFalse, EFalse );
 
     iBitmap = NULL; // owned by server now
-    delete iBuffer;
+    delete iBuffer; // we own the buffer
     iBuffer = NULL;
+    
     Release();
     }