[asterisk-scf-commits] asterisk-scf/release/media_rtp_pjmedia.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Mon Jun 18 11:47:01 CDT 2012
branch "master" has been updated
via 933ffdf5bcb4b74c106c5ac2275b2b1f847a2248 (commit)
from 52e9445fc7ab2a592ecc86e3861a05e0816407ed (commit)
Summary of changes:
src/RTPSession.cpp | 34 ++++++++++++----------------------
1 files changed, 12 insertions(+), 22 deletions(-)
- Log -----------------------------------------------------------------
commit 933ffdf5bcb4b74c106c5ac2275b2b1f847a2248
Author: Brent Eagles <beagles at digium.com>
Date: Mon Jun 18 14:14:06 2012 -0230
Fixed a stray reference count bug in RTPSession. The bug did not exist in
the internal "destroy()" method that is used by replicas so merged the two
and implemented the release() external method in terms of the internal
destroy() method.
diff --git a/src/RTPSession.cpp b/src/RTPSession.cpp
index d3fe04c..72ecc51 100644
--- a/src/RTPSession.cpp
+++ b/src/RTPSession.cpp
@@ -781,29 +781,8 @@ void RTPSessionImpl::release(const Ice::Current&)
// Remove everything from the state replicator if present
removeState(mSessionStateItem, mStreamSink->getStateItem(), mStreamSource->getStateItem());
- /* Drop the source and sink from the ASM */
- mAdapter->remove(mStreamSourceProxy->ice_getIdentity());
- mAdapter->remove(mStreamSinkProxy->ice_getIdentity());
-
- if (mTelephonyEventSourcePrx)
- {
- mAdapter->remove(mTelephonyEventSourcePrx->ice_getIdentity());
- }
- if (mTelephonyEventSinkPrx)
- {
- mAdapter->remove(mTelephonyEventSinkPrx->ice_getIdentity());
- }
-
- /* Since the source and sink have a pointer back to the session we need to get rid of them,
- * which will in turn get rid of ourselves once we are removed from the ASM.
- */
- mStreamSource = 0;
- mStreamSink = 0;
- /* All we have to do is remove ourselves from the ASM, our smart pointerness will cause us to
- * destruct and then cleanup will occur.
- */
- mAdapter->remove(mAdapter->getCommunicator()->stringToIdentity(mId));
+ destroy();
}
/**
@@ -1246,6 +1225,15 @@ void RTPSessionImpl::destroy()
mAdapter->remove(mStreamSourceProxy->ice_getIdentity());
mAdapter->remove(mStreamSinkProxy->ice_getIdentity());
+ if (mTelephonyEventSourcePrx)
+ {
+ mAdapter->remove(mTelephonyEventSourcePrx->ice_getIdentity());
+ }
+ if (mTelephonyEventSinkPrx)
+ {
+ mAdapter->remove(mTelephonyEventSinkPrx->ice_getIdentity());
+ }
+
/* Since both the source and sink have a pointer back to the session we need to get rid of them,
* which will in turn get rid of ourselves once we are removed from the ASM.
*/
@@ -1253,7 +1241,9 @@ void RTPSessionImpl::destroy()
boost::unique_lock<boost::shared_mutex> lock(mLock);
mStreamSource = 0;
mStreamSink = 0;
+
mSessionAdapter.reset();
+ mTransport.reset();
}
/* All we have to do is remove ourselves from the ASM, our smart pointerness will cause us to
-----------------------------------------------------------------------
--
asterisk-scf/release/media_rtp_pjmedia.git
More information about the asterisk-scf-commits
mailing list