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

List:       helix-common-cvs
Subject:    [Common-cvs] lang/xmldom xmlnode.cpp, 1.3.156.1, 1.3.156.2 hxxmlnode.h, 1.3, 1.3.156.1
From:       ryuan () helixcommunity ! org
Date:       2012-08-28 7:16:25
[Download RAW message or body]

Update of /cvsroot/common/lang/xmldom
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv2401/common/lang/xmldom

Modified Files:
      Tag: SERVER_15_0
	xmlnode.cpp hxxmlnode.h 
Log Message:
Synopsis:
=========
CR: Fixes Dash Memory Leak Part3

Branches: SERVER_15_0, head
Suggested Reviewers: James, Xiaocheng and Anyone

Description:
============
There is memory leak in Dash feature. 

Fixes the following memory leak:
1. xmlnode.cpp, 
The CHXXmlAttribute class doesn't have default constructor to init the reference to \
0. After calling GetChildAt(nIndex, &pNode), didn't release pNode.

2. dashmp4streamhandler.cpp 
Didn't release the m_pConfig

3. dashmp4writer.cpp
Didn't release the m_pProperties

4. dashmgr.cpp
Didn't release every object in the array m_ppSegList
In CDashVirtualClient::Init, release the CHXString object which is allocated in \
CDASHPlugin::ProcessLiveConnection.


Files affected:
===============
server_rn/datatype/dashstrmhdl/dashmp4streamhandler.cpp
datatype_rn/dash/mp4/dashmp4writer.cpp
datatype_rn/dash/mp4/dashfraggen.cpp
server_rn/protocol/dash/dashmgr.cpp
common/lang/xmldom/xmlnode.cpp
common/lang/xmldom/hxxmlnode.h

Testing Performed:
================
Unit Tests:
LCT test.

Integration Tests:
None

Leak Tests: None
Performance Tests: N/A

Platforms Tested: win-x86_64-vc10.
Builds Verified: win-x86_64-vc10.

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



Index: xmlnode.cpp
===================================================================
RCS file: /cvsroot/common/lang/xmldom/xmlnode.cpp,v
retrieving revision 1.3.156.1
retrieving revision 1.3.156.2
diff -u -d -r1.3.156.1 -r1.3.156.2
--- xmlnode.cpp	20 Jul 2012 10:54:39 -0000	1.3.156.1
+++ xmlnode.cpp	28 Aug 2012 07:16:12 -0000	1.3.156.2
@@ -53,6 +53,15 @@
 /*************************************************************
     class CHXXmlAttribute
 *************************************************************/
+CHXXmlAttribute::CHXXmlAttribute() : m_nRefCount(0)
+{
+}
+
+CHXXmlAttribute::~CHXXmlAttribute()
+{
+}
+
+
 STDMETHODIMP_(ULONG32) CHXXmlAttribute::AddRef(void)
 {
     return InterlockedIncrement(&m_nRefCount);
@@ -455,7 +464,7 @@
                     m_strInnerXml += "\n  ";
                 }
             }
-            
+            HX_RELEASE(pNode);
         }
     }
 

Index: hxxmlnode.h
===================================================================
RCS file: /cvsroot/common/lang/xmldom/hxxmlnode.h,v
retrieving revision 1.3
retrieving revision 1.3.156.1
diff -u -d -r1.3 -r1.3.156.1
--- hxxmlnode.h	6 Jul 2007 20:43:48 -0000	1.3
+++ hxxmlnode.h	28 Aug 2012 07:16:13 -0000	1.3.156.1
@@ -55,6 +55,8 @@
 class CHXXmlAttribute : public IUnknown
 {
 public:
+    CHXXmlAttribute();
+    virtual ~CHXXmlAttribute();
    // IUnknown
     STDMETHOD(QueryInterface)           (THIS_ REFIID riid, void** ppvObj);
     STDMETHOD_(ULONG32,AddRef)          (THIS);


_______________________________________________
Common-cvs mailing list
Common-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/common-cvs


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

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