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

List:       helix-server-cvs
Subject:    [Server-cvs] engine/session clientsession.cpp,1.112,1.113
From:       dcollins () helixcommunity ! org
Date:       2008-07-30 22:39:34
Message-ID: 200807302242.m6UMgHef026605 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/server/engine/session
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv5985

Modified Files:
	clientsession.cpp 
Log Message:
Synopsis
========
Fixes a per-player memory leak with on-demand multirate 3gp content.

Branches: SERVER_11_1, SERVER_12_0, SERVER_12_1, HEAD
Reviewers: Atin, Jamie


Description
===========

This fixes a per-player memory leak encountered in the 11.1.8 uptimes,
related to PRs 223639 and 224951.  It occurs with on-demand multi-rate
3gp content.

In Player::Session::HandleStreamAdaptation() we set a
StreamAdaptationParams pointer without deleting the object it already
points to, leaking the first object.  By adding HX_DELETE() before
assigning the new value to the pointer we can prevent this leak.

I ran leak-checks against v12 as well, and the leak does not occur.
Presumably the code behaves better in v12 and it does not reassign this
pointer.  For the v12.0 and v12.1 branches and the CVS HEAD I added the
pointer check for safety anyhow, as well as an assert.


Files Affected
==============

server/engine/session/player.cpp [SERVER_11_1]
server/engine/session/clientsession.cpp [all other branches]


Testing Performed
=================

Unit Tests:
- None

Integration Tests:
- Tested while leak-checking the change.
- Will run in a full uptime test immediatly post-checkin.

Leak Tests:
- Verified that zero bytes leaked after the change.

Performance Tests:
- None

Platforms Tested: linux-rhel4-i686
Build verified: linux-rhel4-i686


QA Hints
========
- An uptime test on all platforms is necessary.
- An lct test on at least one platform is necessary.


Index: clientsession.cpp
===================================================================
RCS file: /cvsroot/server/engine/session/clientsession.cpp,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- clientsession.cpp	24 Jul 2008 18:41:19 -0000	1.112
+++ clientsession.cpp	30 Jul 2008 22:39:32 -0000	1.113
@@ -4335,6 +4335,9 @@
             if (streamAdapt.m_unStreamNum <= (m_num_streams - 1))
             {
                 m_unStreamAdaptSetupCount++;
+                HX_ASSERT(NULL == m_ppStreams[streamAdapt.m_unStreamNum]->m_pStreamAdaptParams);
+                //Delete params for safety anyhow even though they should not be set.
+                HX_DELETE(m_ppStreams[streamAdapt.m_unStreamNum]->m_pStreamAdaptParams);
                 m_ppStreams[streamAdapt.m_unStreamNum]->m_pStreamAdaptParams
                     = new StreamAdaptationParams;
                 *(m_ppStreams[streamAdapt.m_unStreamNum]->m_pStreamAdaptParams)


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

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