From 8a6e4bec6b6c3576978324d85d1bc8d163a3ed26 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Mon, 3 Dec 2007 09:02:33 +0000 Subject: [PATCH] - resolved possible race condition (thx to Mark Sidell for reporting). git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@564 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/AmSessionContainer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/AmSessionContainer.cpp b/core/AmSessionContainer.cpp index 819f5147..e375e2b2 100644 --- a/core/AmSessionContainer.cpp +++ b/core/AmSessionContainer.cpp @@ -270,14 +270,16 @@ bool AmSessionContainer::postEvent(const string& callid, as_mut.lock(); AmSession* s = getSession(callid,remote_tag); - as_mut.unlock(); if(!s){ + as_mut.unlock(); delete event; return false; } s->postEvent(event); + as_mut.unlock(); + return true; } @@ -287,12 +289,13 @@ bool AmSessionContainer::postEvent(const string& local_tag, // DBG("postEvent: local_tag = %s\n",local_tag.c_str()); as_mut.lock(); AmSession* s = getSession(local_tag); - as_mut.unlock(); if (s != NULL) { s->postEvent(event); + as_mut.unlock(); return true; } + as_mut.unlock(); // try session factories AmSessionFactory* sf = AmPlugIn::instance()->getFactory4App(local_tag);