[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-clientapps-cvs
Subject:    [Clientapps-cvs] symbianMmf hxmmfcontext.cpp, 1.1,
From:       rrajesh () helixcommunity ! org
Date:       2007-08-28 20:02:24
Message-ID: 200708282002.l7SK2dZb008140 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/clientapps/symbianMmf
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv9835

Modified Files:
	hxmmfcontext.cpp hxmmfplayctrl.cpp 
Log Message:
"Nokia submits this code under the terms of a commercial contribution agreement with \
RealNetworks, and I am authorized to contribute this code under said agreement."

Modified by:  rajesh.rathinasamy@nokia.com

Reviewed by: 

Date: 27-Aug-2007

Project: SymbianMmf

ErrorId: RRAY-76HQZS
            
Synopsis:  CR: Memory leak fix for streaming cases

During recent MMF controller log system changed, the Globaldata to hold the \
Accesspath has been moved to playcontroller as it was used by MMF context for log \
dll. But in few cases MMF controller does not create playcontroller resulting in \
Globaldata being leaked. The original change was tested for memory leak last time \
with local clip and that is the reason why it was not caught last time.

Solution was to move the deletion of GlobalData to MMFContext which is the last \
MMF/Helix COM object.   
Root Cause of the problem: Implementation. 
 
Files Modified:
clientapps/symbianMmf/hxmmfcontext.cpp
clientapps/symbianMmf/hxmmfplayctrl.cpp

Image Size and Heap Use impact: no impact

Module Release testing (STIF) :  Passed.

Test case(s) Added  :  No. (Current streaming cases covers this case)

Memory leak check performed : Yes.  No new leaks introduced. 

Platforms and Profiles Build Verified: helix-client-s60-32-mmf-mdf-arm

Platforms and Profiles Functionality verified: armv5,winscw

Branch: Head & 210CayS


Index: hxmmfcontext.cpp
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/hxmmfcontext.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- hxmmfcontext.cpp	16 Aug 2007 19:28:56 -0000	1.1
+++ hxmmfcontext.cpp	28 Aug 2007 20:02:21 -0000	1.2
@@ -69,11 +69,36 @@
 #include "symbian_string.h"
 #include "ihxtlogsystem.h"
 #include "hxplugn.h"
+#include "dllpath.h"
 #include "dllacces.h"
 #include "hxdllaccess.h"
 #include "hxplugindll.h"
 #include "symbian_gm_inst.h"
 
+struct GlobalData
+{
+    DLLAccessPath        accessPath;
+};
+
+GlobalData*& GetGlobal()
+{
+    static const int key = 0; // address of static var (we hope) comprises unique \
key id +    GlobalData*& g_pGlobalData = (GlobalData*&)HXGlobalPtr::Get(&key);
+
+    if(!g_pGlobalData)
+    {
+        g_pGlobalData = new GlobalData();
+    }
+    return g_pGlobalData;
+}
+
+// required for class DLLAccess
+DLLAccessPath* GetDLLAccessPath()
+{
+    return &(GetGlobal()->accessPath);
+}
+
+
 BEGIN_INTERFACE_LIST(HXMMFContext)
 INTERFACE_LIST_ENTRY_DELEGATE_BLIND(QueryInterfaceDelegates)
 END_INTERFACE_LIST
@@ -119,6 +144,10 @@
 HXMMFContext::~HXMMFContext()
 {
     Close();
+    
+    // Delete the global data used by DLLAccess
+    GlobalData*& pGlobal = GetGlobal();
+    HX_DELETE(pGlobal);
 }
 
 

Index: hxmmfplayctrl.cpp
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/hxmmfplayctrl.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- hxmmfplayctrl.cpp	16 Aug 2007 19:27:05 -0000	1.17
+++ hxmmfplayctrl.cpp	28 Aug 2007 20:02:21 -0000	1.18
@@ -75,32 +75,7 @@
     }
 }
 
-struct GlobalData
-{
-    DLLAccessPath        accessPath;
-};
-
-GlobalData*& GetGlobal()
-{
-#if defined(HELIX_CONFIG_NOSTATICS)
-    static const int key = 0; // address of static var (we hope) comprises unique \
                key id
-    GlobalData*& g_pGlobalData = (GlobalData*&)HXGlobalPtr::Get(&key);
-#else
-    static GlobalData* g_pGlobalData = NULL;
-#endif
-
-    if(!g_pGlobalData)
-    {
-        g_pGlobalData = new GlobalData();
-    }
-    return g_pGlobalData;
-}
 
-// required for class DLLAccess
-DLLAccessPath* GetDLLAccessPath()
-{
-    return &(GetGlobal()->accessPath);
-}
 
 HXMMFPlayCtrl::HXMMFPlayCtrl(MHXControllerProperties *pProp)
     : m_pHXPlayer(NULL)
@@ -496,9 +471,6 @@
         HX_DELETE(m_pDllAccess);
     }
 
-    GlobalData*& pGlobal = GetGlobal();
-    HX_DELETE(pGlobal);
-
     m_fpCloseEngine = 0;
     m_fpCreateEngine = 0;
 }


_______________________________________________
Clientapps-cvs mailing list
Clientapps-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/clientapps-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic