imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailimagedecoderv3.cpp
changeset 25 cb86b71cae0a
parent 19 b790c5b3d11f
child 29 4bdfb6b5c9b4
--- a/imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailimagedecoderv3.cpp	Thu May 27 13:11:20 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailimagedecoderv3.cpp	Fri Jun 11 13:58:45 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();
     }