[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-server-cvs
Subject: [Server-cvs] engine/session clientsession.cpp,1.12.2.41,1.12.2.42
From: dsingh () helixcommunity ! org
Date: 2007-09-27 14:01:45
Message-ID: 200709271401.l8RE1ua3009872 () mailer ! progressive-comp ! com
[Download RAW message or body]
Update of /cvsroot/server/engine/session
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv11290
Modified Files:
Tag: SERVER_BORABORA
clientsession.cpp
Log Message:
Synopsis
========
Fix for Assertion failure due to non freeing of member object.
Branches: SERVER_BORABORA_RN, HEAD
Suggested Reviewer: Jamie, anyone
Description
===========
While testing for my FCS changes, I found that an assertion \
"HX_ASSERT(!m_pSrcFinder);" in function ClientSession::FindSource() is failing at \
line 3370 in file clientsession.cpp. In case of HTTP FCS request, after the clip has \
been found the member object pointer "m_pSrcFinder" should be freed. This is being \
freed in case of successful finding of new clip but if requested clip not found it \
was not being freed. In Release build it results into a memory leak. So to fix this, \
the pointer is now freed in function ClientSession::HandleSourceSwitch() if clip is \
not found.
Files Affected
==============
server/engine/session/clientsession.cpp
Testing Performed
=================
Unit Tests:
N/A
Integration Tests:
Verified by testing the same scenario in which assert was failing. Now no assertion \
is failing an no CA is observed due to null pointer.
Leak Tests:
N/A
Performance Tests:
- None
Platforms Tested: win32-vc7-i386
Build verified: win32-vc7-i386, linux-rhel4-i686.
Regards
-Dalvinder
Index: clientsession.cpp
===================================================================
RCS file: /cvsroot/server/engine/session/clientsession.cpp,v
retrieving revision 1.12.2.41
retrieving revision 1.12.2.42
diff -u -d -r1.12.2.41 -r1.12.2.42
--- clientsession.cpp 21 Sep 2007 20:45:55 -0000 1.12.2.41
+++ clientsession.cpp 27 Sep 2007 14:01:42 -0000 1.12.2.42
@@ -598,16 +598,6 @@
m_pClient->GetProtocol()->setupStreams(0, this, CONVERT_HXR_ERROR(status));
}
- else //succeeded
- {
- /* done with finder */
- if (m_pSrcFinder)
- {
- m_pSrcFinder->Close();
- m_pSrcFinder->Release();
- m_pSrcFinder = NULL;
- }
- }
init_done_exit:
// Left Function
@@ -3217,20 +3207,21 @@
if (!m_pSrcFinder)
{
theErr = HXR_OUTOFMEMORY;
+ goto cleanup;
}
- if (HXR_OK == theErr)
- {
- m_pSrcFinder->AddRef();
- theErr = m_pSrcFinder->Init(this, m_pQoSConfig);
- }
-
+ m_pSrcFinder->AddRef();
+ theErr = m_pSrcFinder->Init(this, m_pQoSConfig);
if (HXR_OK == theErr)
{
theErr = m_pSrcFinder->FindSource(pURL, pRequest);
// continues in FindSourceDone()
}
+ /* We can close m_pSrcFinder, it is not needed now */
+ m_pSrcFinder->Close();
+ HX_RELEASE(m_pSrcFinder);
+cleanup:
// Left Function
--m_ulFunctionsInUse;
IfDoneCleanup();
@@ -6142,12 +6133,6 @@
{
return CallSwitchDone(status);
}
- if (m_pSession->m_pSrcFinder)
- {
- m_pSession->m_pSrcFinder->Close();
- m_pSession->m_pSrcFinder->Release();
- m_pSession->m_pSrcFinder = NULL;
- }
return m_pRealSourceControl->GetFileHeader(this);
//continue in FileHeaderReady
}
_______________________________________________
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