[ekiga] Ekiga::CallCore doesn't need to manage some of its connections



commit 88c22e2adaaacb4abbaa572729798e36be2fb055
Author: Julien Puydt <jpuydt free fr>
Date:   Sat Feb 9 22:41:15 2013 +0100

    Ekiga::CallCore doesn't need to manage some of its connections

 lib/engine/protocol/call-core.cpp |   12 +-----------
 lib/engine/protocol/call-core.h   |   13 +++++--------
 2 files changed, 6 insertions(+), 19 deletions(-)
---
diff --git a/lib/engine/protocol/call-core.cpp b/lib/engine/protocol/call-core.cpp
index dd6fbbb..d769a29 100644
--- a/lib/engine/protocol/call-core.cpp
+++ b/lib/engine/protocol/call-core.cpp
@@ -45,22 +45,12 @@
 
 using namespace Ekiga;
 
-
-CallCore::~CallCore ()
-{
-  for (std::list<boost::signals::connection>::iterator iter = manager_connections.begin ();
-       iter != manager_connections.end ();
-       ++iter)
-    iter->disconnect ();
-}
-
-
 void CallCore::add_manager (boost::shared_ptr<CallManager> manager)
 {
   managers.insert (manager);
   manager_added (manager);
 
-  manager_connections.push_back (manager->ready.connect (boost::bind (&CallCore::on_manager_ready, this, manager)));
+  manager->ready.connect (boost::bind (&CallCore::on_manager_ready, this, manager));
 }
 
 
diff --git a/lib/engine/protocol/call-core.h b/lib/engine/protocol/call-core.h
index bbd7f6b..df5ab1e 100644
--- a/lib/engine/protocol/call-core.h
+++ b/lib/engine/protocol/call-core.h
@@ -43,10 +43,11 @@
 #include "call.h"
 #include "call-manager.h"
 #include "call-protocol-manager.h"
-#include <boost/smart_ptr.hpp>
 
+#include <boost/smart_ptr.hpp>
 #include <boost/signals.hpp>
 #include <boost/bind.hpp>
+
 #include <set>
 #include <map>
 #include <iostream>
@@ -62,8 +63,9 @@ namespace Ekiga
 
   class CallManager;
 
-  class CallCore
-    : public Service
+  class CallCore:
+    public Service,
+    public boost::signals::trackable
     {
 
   public:
@@ -74,10 +76,6 @@ namespace Ekiga
        */
       CallCore () { nr_ready = 0; }
 
-      /** The destructor
-       */
-      ~CallCore ();
-
 
       /*** Service Implementation ***/
 
@@ -186,7 +184,6 @@ namespace Ekiga
 
       
       std::set<boost::shared_ptr<CallManager> > managers;
-      std::list<boost::signals::connection> manager_connections;
       std::map<std::string, std::list<boost::signals::connection> > call_connections;
       unsigned nr_ready;
     };


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]