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

List:       helix-datatype-cvs
Subject:    [Datatype-cvs] mp4/filewriter mp4sm.cpp,1.47,1.48
From:       mandagod () helixcommunity ! org
Date:       2013-09-12 3:58:36
[Download RAW message or body]

Update of /cvsroot/datatype/mp4/filewriter
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv21259/datatype/mp4/filewriter

Modified Files:
	mp4sm.cpp 
Log Message:
Synopsis:
=========
fix-HLXSRV-667 --[Memory Leak] Live Archiving will generate memory leak

Branch: SERVER_15_1_0_RN, HEAD

Suggested Reviewers: Anyone

Description:
There will be memory leak in each hour, because of the archived temp file will
be translated to file stored on server's disk, and there are 4 ingress streams,
   and 4 files will be recorded.

   Solutions:
   The CMP4FileWriter, CMP4StreamMixer and CMP4Archiver contains the refernces
   with each other, so can't release the Atoms related objects.
   Cahnge the releasing order, that can release the Atoms related objects.

   Files affected:
   ===============
   datatype/mp4/filewriter/mp4sm.cpp
   server-restricted/broadcast/app/archiving/archclnt.cpp

   Testing Performed:
   ================
   Unit Tests:
   None

   Integration Tests:

   Leak Tests: None
   Performance Tests: N/A

   Platforms Tested: win-x86_64-vc10

   Builds Verified: win-x86_64-vc10

   QA Hints
   ========
   None.


Index: mp4sm.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/filewriter/mp4sm.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- mp4sm.cpp	26 Sep 2011 19:52:53 -0000	1.47
+++ mp4sm.cpp	12 Sep 2013 03:58:28 -0000	1.48
@@ -692,6 +692,7 @@
 
 CMP4StreamMixer::HintInfo::~HintInfo()
 {
+    HX_DELETE(stblmgr);
 }
 
 CMP4StreamMixer::CMP4StreamMixer(IUnknown* pContext, CMP4Archiver* pArchiver)
@@ -754,10 +755,9 @@
 
 CMP4StreamMixer::~CMP4StreamMixer()
 {
-    HX_RELEASE( m_pArchiver );
     HX_RELEASE( m_pRootAtom );
     HX_RELEASE( m_pFileHeader );
-    HX_VECTOR_DELETE(m_pStreamInfo);
+
     HX_RELEASE( m_pContext );
     HX_DELETE(m_pPacketListAfterRoll);
 }
@@ -1668,8 +1668,12 @@
     {
         retVal = CloseFile();
         m_pArchiver->Done();
+        
         m_pMdhd = NULL;
         m_pMvhd = NULL;
+        HX_RELEASE( m_pArchiver );
+        //Delete stream info
+        HX_VECTOR_DELETE(m_pStreamInfo);
     }
 
     return retVal;


_______________________________________________
Datatype-cvs mailing list
Datatype-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/datatype-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

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