[ekiga: 1/2] Fixed crash in the opal call manager
- From: Julien Puydt <jpuydt src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [ekiga: 1/2] Fixed crash in the opal call manager
- Date: Sat, 5 Sep 2009 19:48:38 +0000 (UTC)
commit 28ed1d3a49a2706bbb93e60fcd8a9c8a467274d9
Author: Julien Puydt <jpuydt gnome org>
Date: Sat Sep 5 21:27:13 2009 +0200
Fixed crash in the opal call manager
We were building a shared pointer on this... which wasn't
really shared, and hence made the call manager get disposed
of after the first call... leading to a crash later.
lib/engine/components/opal/opal-call-manager.cpp | 2 +-
lib/engine/components/opal/opal-call-manager.h | 9 ++++++---
2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-call-manager.cpp b/lib/engine/components/opal/opal-call-manager.cpp
index 77da4ea..f3d9da2 100644
--- a/lib/engine/components/opal/opal-call-manager.cpp
+++ b/lib/engine/components/opal/opal-call-manager.cpp
@@ -634,7 +634,7 @@ CallManager::create_call_in_main (Opal::Call* call)
boost::shared_ptr<Ekiga::CallCore> call_core = core.get<Ekiga::CallCore> ("call-core");
call_core->add_call (boost::shared_ptr<Opal::Call>(call),
- boost::shared_ptr<CallManager>(this));
+ boost::dynamic_pointer_cast<CallManager>(shared_from_this ()));
}
OpalCall *CallManager::CreateCall (void *uri)
diff --git a/lib/engine/components/opal/opal-call-manager.h b/lib/engine/components/opal/opal-call-manager.h
index 97ad1a6..aaa8bec 100644
--- a/lib/engine/components/opal/opal-call-manager.h
+++ b/lib/engine/components/opal/opal-call-manager.h
@@ -60,6 +60,7 @@
#include <boost/signals.hpp>
#include <boost/bind.hpp>
+#include <boost/enable_shared_from_this.hpp>
#include <string>
@@ -68,9 +69,11 @@ class GMPCSSEndpoint;
namespace Opal {
- class CallManager : public Ekiga::Service,
- public Ekiga::CallManager,
- public OpalManager
+ class CallManager :
+ public boost::enable_shared_from_this<CallManager>,
+ public Ekiga::Service,
+ public Ekiga::CallManager,
+ public OpalManager
{
PCLASSINFO(CallManager, OpalManager);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]