photosgallery/viewframework/tvout/src/glxhdmisurfaceupdater.cpp
branchRCL_3
changeset 75 01504893d9cb
parent 68 5b238bc8ffb6
--- a/photosgallery/viewframework/tvout/src/glxhdmisurfaceupdater.cpp	Wed Sep 15 12:13:06 2010 +0300
+++ b/photosgallery/viewframework/tvout/src/glxhdmisurfaceupdater.cpp	Wed Oct 13 14:32:09 2010 +0300
@@ -71,9 +71,6 @@
     TRAP_IGNORE(iDecoderObserver.HandleHDMIDecodingEventL(EHdmiDisconnected));
 
     ReleaseContent();
-
-    delete iNextImagePath;
-
     if (iWindow)
         {
         iWindow->RemoveBackgroundSurface(ETrue);
@@ -83,8 +80,11 @@
         iTimer->Cancel();
         }
     delete iTimer;
-    delete iGlxDecoderAO;
-    delete iSurfBufferAO;
+    if (iGlxDecoderAO)
+        {
+        delete iGlxDecoderAO;
+        }
+    iGlxDecoderAO = NULL;
     iFsSession.Close();
     if (iSurfManager)
         {
@@ -99,6 +99,7 @@
             iSurfChunk->Close();
             }
         delete iSurfChunk;
+        iSurfChunk = NULL;
         GLX_LOG_INFO(
                 "CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater(). iSurfManager->CloseSurface()");
         iSurfManager->CloseSurface(iSurfId);
@@ -106,6 +107,7 @@
                 "CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater(). iSurfManager->Close()");
         iSurfManager->Close();
         delete iSurfManager;
+        iSurfManager = NULL;
         }
     }
 
@@ -236,9 +238,6 @@
         const TDesC& aNextImageFile, CFbsBitmap* aFsBitmap)
     {
     TRACER("CGlxHdmiSurfaceUpdater::UpdateNewImageL()");
-    delete iNextImagePath;
-    iNextImagePath = NULL;
-
     if (!aImageFile.CompareC(*iImagePath) && !iDecodingCurrent
             && !iDecodingNext)
         {
@@ -269,6 +268,11 @@
     else
         {
         ReleaseContent();
+		if (iNextImagePath)
+			{
+			delete iNextImagePath;
+			iNextImagePath = NULL;
+			}
 		// Ongoing decoding is cancelled if any,reset the decoding flags. 
 		iDecodingNext = EFalse;
 		iDecodingCurrent = EFalse;
@@ -1000,8 +1004,11 @@
     TRACER("CGlxHdmiSurfaceUpdater::DecodeNextImageL()");
     ReleaseContent();
     iImagePath = iNextImagePath->Alloc();
-    delete iNextImagePath;
-    iNextImagePath = NULL;
+    if (iNextImagePath)
+        {
+        delete iNextImagePath;
+        iNextImagePath = NULL;
+        }
     iIsNonJpeg = EFalse;
     GLX_LOG_INFO("Before - iWindow->Size()");
     iTvScreenSize = iWindow->Size();