[ekiga] Got rid of the infamous crash on exit... by not managing deallocation of opal endpoints ourselves



commit af47729a21a17459d9a098e10fd8daaccd5aa7a5
Author: Julien Puydt <jpuydt newton localdomain>
Date:   Sat Sep 24 13:28:47 2011 +0200

    Got rid of the infamous crash on exit... by not managing deallocation of opal endpoints ourselves
    
    Oh, and that also means that my bugfix for bug #622001 can be confirmed to work!

 lib/engine/components/opal/opal-main.cpp |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-main.cpp b/lib/engine/components/opal/opal-main.cpp
index c1dbb76..0758734 100644
--- a/lib/engine/components/opal/opal-main.cpp
+++ b/lib/engine/components/opal/opal-main.cpp
@@ -56,6 +56,13 @@
 #define H323_KEY "/apps/" PACKAGE_NAME "/protocols/h323/"
 #endif
 
+// opal manages its endpoints itself, so we must be wary
+struct null_deleter
+{
+    void operator()(void const *) const
+    { }
+};
+
 static bool
 is_supported_address (const std::string uri)
 {
@@ -109,7 +116,7 @@ struct OPALSpark: public Ekiga::Spark
       core.add (call_manager);
 
       unsigned sip_port = gm_conf_get_int (SIP_KEY "listen_port");
-      boost::shared_ptr<Sip::EndPoint> sip_manager (new Sip::EndPoint (*call_manager, core, sip_port));
+      boost::shared_ptr<Sip::EndPoint> sip_manager (new Sip::EndPoint (*call_manager, core, sip_port), null_deleter ());
       core.add (sip_manager);
 
       call_manager->add_protocol_manager (sip_manager);
@@ -124,9 +131,10 @@ struct OPALSpark: public Ekiga::Spark
       presence_core->add_presence_publisher (bank);
       presence_core->add_presence_fetcher (bank);
 
+
 #ifdef HAVE_H323
       unsigned h323_port = gm_conf_get_int (H323_KEY "listen_port");
-      boost::shared_ptr<H323::EndPoint> h323_manager (new H323::EndPoint (*call_manager, core, h323_port));
+      boost::shared_ptr<H323::EndPoint> h323_manager (new H323::EndPoint (*call_manager, core, h323_port), null_deleter ());
       call_manager->add_protocol_manager (h323_manager);
       contact_core->add_contact_decorator (h323_manager);
       presence_core->add_presentity_decorator (h323_manager);



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