[ekiga/ds-fix-boost-leaks] Ekiga: Uniformised leaks debug output.



commit 13468e2b11d2f0b3e10630245446476e9122c21f
Author: Damien Sandras <dsandras seconix com>
Date:   Sat Oct 10 14:03:34 2015 +0200

    Ekiga: Uniformised leaks debug output.

 lib/engine/account/account-core.cpp                |    8 ++++++++
 lib/engine/addressbook/contact-core.cpp            |    3 ---
 lib/engine/audioinput/audioinput-core.cpp          |    8 ++++++++
 lib/engine/audiooutput/audiooutput-core.cpp        |   12 +++++++++---
 .../components/call-history/history-book.cpp       |    4 +---
 .../components/call-history/history-contact.cpp    |    3 ---
 .../components/call-history/history-source.cpp     |    3 ---
 lib/engine/components/opal/h323-call-manager.cpp   |    6 +++++-
 lib/engine/components/opal/opal-account.cpp        |    3 ---
 lib/engine/components/opal/opal-bank.cpp           |    4 ----
 lib/engine/components/opal/opal-call-manager.cpp   |    3 ---
 lib/engine/components/opal/opal-presentity.cpp     |    3 ---
 lib/engine/components/opal/sip-call-manager.cpp    |    6 +++++-
 lib/engine/framework/dynamic-object.h              |   11 +++++++++++
 lib/engine/framework/services.cpp                  |    5 ++++-
 lib/engine/gui/gtk-core/gtk-core.cpp               |   12 ++++++++++++
 lib/engine/gui/gtk-core/gtk-core.h                 |    3 +--
 lib/engine/hal/hal-core.cpp                        |   10 ++++++++++
 lib/engine/presence/presence-core.cpp              |    5 +++++
 lib/engine/protocol/call-core.cpp                  |    7 ++++++-
 lib/engine/videoinput/videoinput-core.cpp          |   12 ++++++++----
 lib/engine/videooutput/videooutput-core.cpp        |    8 +++++++-
 plugins/avahi/avahi-heap.cpp                       |    7 -------
 plugins/evolution/evolution-book.cpp               |    4 ----
 plugins/evolution/evolution-contact.cpp            |    7 -------
 plugins/evolution/evolution-source.cpp             |    5 -----
 plugins/ldap/ldap-book.cpp                         |    3 ---
 plugins/ldap/ldap-contact.cpp                      |    3 ---
 plugins/ldap/ldap-source.cpp                       |    3 ---
 29 files changed, 100 insertions(+), 71 deletions(-)
---
diff --git a/lib/engine/account/account-core.cpp b/lib/engine/account/account-core.cpp
index 732de8e..e033bd6 100644
--- a/lib/engine/account/account-core.cpp
+++ b/lib/engine/account/account-core.cpp
@@ -32,6 +32,11 @@
  *
  */
 
+#if DEBUG
+#include <typeinfo>
+#include <iostream>
+#endif
+
 #include "account-core.h"
 #include "bank.h"
 
@@ -42,6 +47,9 @@ Ekiga::AccountCore::AccountCore ()
 
 Ekiga::AccountCore::~AccountCore ()
 {
+#if DEBUG
+  std::cout << "Destroyed object of type " << typeid(*this).name () << std::endl;
+#endif
 }
 
 
diff --git a/lib/engine/addressbook/contact-core.cpp b/lib/engine/addressbook/contact-core.cpp
index 6e54ad9..0a62e08 100644
--- a/lib/engine/addressbook/contact-core.cpp
+++ b/lib/engine/addressbook/contact-core.cpp
@@ -48,9 +48,6 @@ on_search ()
 
 Ekiga::ContactCore::~ContactCore ()
 {
-#if DEBUG
-  std::cout << "Ekiga::ConcactCore: Destructor invoked" << std::endl << std::flush;
-#endif
 }
 
 void
diff --git a/lib/engine/audioinput/audioinput-core.cpp b/lib/engine/audioinput/audioinput-core.cpp
index e0d940b..b071f1a 100644
--- a/lib/engine/audioinput/audioinput-core.cpp
+++ b/lib/engine/audioinput/audioinput-core.cpp
@@ -33,7 +33,11 @@
  *
  */
 
+#if DEBUG
+#include <typeinfo>
 #include <iostream>
+#endif
+
 #include <math.h>
 
 #include <glib/gi18n.h>
@@ -102,6 +106,10 @@ AudioInputCore::~AudioInputCore ()
 
   g_clear_object (&audio_device_settings);
   managers.clear();
+
+#if DEBUG
+  std::cout << "Destroyed object of type " << typeid(*this).name () << std::endl;
+#endif
 }
 
 void
diff --git a/lib/engine/audiooutput/audiooutput-core.cpp b/lib/engine/audiooutput/audiooutput-core.cpp
index 27d05b4..29982c8 100644
--- a/lib/engine/audiooutput/audiooutput-core.cpp
+++ b/lib/engine/audiooutput/audiooutput-core.cpp
@@ -33,6 +33,11 @@
  *
  */
 
+#if DEBUG
+#include <typeinfo>
+#include <iostream>
+#endif
+
 #include <algorithm>
 #include <math.h>
 
@@ -112,9 +117,6 @@ AudioOutputCore::AudioOutputCore (Ekiga::ServiceCore& core)
 
 AudioOutputCore::~AudioOutputCore ()
 {
-#if DEBUG
-  std::cout << "AudioOutputCore: Destructor invoked" << std::endl;
-#endif
   PWaitAndSignal m_pri(core_mutex[primary]);
   PWaitAndSignal m_sec(core_mutex[secondary]);
 
@@ -129,6 +131,10 @@ AudioOutputCore::~AudioOutputCore ()
 
   g_clear_object (&sound_events_settings);
   g_clear_object (&audio_device_settings);
+
+#if DEBUG
+  std::cout << "Destroyed object of type " << typeid(*this).name () << std::endl;
+#endif
 }
 
 
diff --git a/lib/engine/components/call-history/history-book.cpp 
b/lib/engine/components/call-history/history-book.cpp
index c2bafaa..61dba41 100644
--- a/lib/engine/components/call-history/history-book.cpp
+++ b/lib/engine/components/call-history/history-book.cpp
@@ -67,11 +67,9 @@ History::Book::Book (Ekiga::ServiceCore& core):
 
 History::Book::~Book ()
 {
-#if DEBUG
-  std::cout << __FUNCTION__ << " invoked in " << __FILE__ << std::endl << std::flush;
-#endif
 }
 
+
 const std::string
 History::Book::get_name () const
 {
diff --git a/lib/engine/components/call-history/history-contact.cpp 
b/lib/engine/components/call-history/history-contact.cpp
index da1f2f0..0d3b822 100644
--- a/lib/engine/components/call-history/history-contact.cpp
+++ b/lib/engine/components/call-history/history-contact.cpp
@@ -176,9 +176,6 @@ History::Contact::Contact (boost::shared_ptr<Ekiga::ContactCore> _contact_core,
 
 History::Contact::~Contact ()
 {
-#if DEBUG
-  std::cout << __FUNCTION__ << " invoked in " << __FILE__ << std::endl << std::flush;
-#endif
 }
 
 const std::string
diff --git a/lib/engine/components/call-history/history-source.cpp 
b/lib/engine/components/call-history/history-source.cpp
index 3eab14a..40335cf 100644
--- a/lib/engine/components/call-history/history-source.cpp
+++ b/lib/engine/components/call-history/history-source.cpp
@@ -52,9 +52,6 @@ History::Source::Source (Ekiga::ServiceCore &_core): core(_core)
 
 History::Source::~Source ()
 {
-#if DEBUG
-  std::cout << __FUNCTION__ << " invoked in " << __FILE__ << std::endl << std::flush;
-#endif
 }
 
 const std::list<std::string>
diff --git a/lib/engine/components/opal/h323-call-manager.cpp 
b/lib/engine/components/opal/h323-call-manager.cpp
index cb22b46..43273f1 100644
--- a/lib/engine/components/opal/h323-call-manager.cpp
+++ b/lib/engine/components/opal/h323-call-manager.cpp
@@ -35,6 +35,10 @@
  *
  */
 
+#if DEBUG
+#include <typeinfo>
+#include <iostream>
+#endif
 
 #include "config.h"
 
@@ -64,7 +68,7 @@ Opal::H323::CallManager::CallManager (Ekiga::ServiceCore& _core,
 Opal::H323::CallManager::~CallManager ()
 {
 #if DEBUG
-  std::cout << "Opal::H323::CallManager: Destructor invoked" << std::endl;
+  std::cout << "Destroyed object of type " << typeid(*this).name () << std::endl;
 #endif
 }
 
diff --git a/lib/engine/components/opal/opal-account.cpp b/lib/engine/components/opal/opal-account.cpp
index ab5b2bd..285202a 100644
--- a/lib/engine/components/opal/opal-account.cpp
+++ b/lib/engine/components/opal/opal-account.cpp
@@ -274,9 +274,6 @@ Opal::Account::Account (Opal::Bank & _bank,
 
 Opal::Account::~Account ()
 {
-#if DEBUG
-  std::cout << __FUNCTION__ << " invoked in " << __FILE__ << std::endl << std::flush;
-#endif
 }
 
 
diff --git a/lib/engine/components/opal/opal-bank.cpp b/lib/engine/components/opal/opal-bank.cpp
index f7a845a..f8b8f16 100644
--- a/lib/engine/components/opal/opal-bank.cpp
+++ b/lib/engine/components/opal/opal-bank.cpp
@@ -93,10 +93,6 @@ Opal::Bank::Bank (Ekiga::ServiceCore& core,
 
 Opal::Bank::~Bank ()
 {
-#if DEBUG
-    std::cout << __FUNCTION__ << " invoked in " << __FILE__ << std::endl << std::flush;
-#endif
-
   delete protocols_settings;
 }
 
diff --git a/lib/engine/components/opal/opal-call-manager.cpp 
b/lib/engine/components/opal/opal-call-manager.cpp
index be2f80c..6ccc508 100644
--- a/lib/engine/components/opal/opal-call-manager.cpp
+++ b/lib/engine/components/opal/opal-call-manager.cpp
@@ -63,9 +63,6 @@ Opal::CallManager::CallManager (Ekiga::ServiceCore& _core,
 
 Opal::CallManager::~CallManager ()
 {
-#if DEBUG
-  std::cout << "Opal::CallManager: Destructor invoked" << std::endl;
-#endif
 }
 
 
diff --git a/lib/engine/components/opal/opal-presentity.cpp b/lib/engine/components/opal/opal-presentity.cpp
index e4adcb2..b877c08 100644
--- a/lib/engine/components/opal/opal-presentity.cpp
+++ b/lib/engine/components/opal/opal-presentity.cpp
@@ -128,9 +128,6 @@ Opal::Presentity::Presentity (const Opal::Account & account_,
 
 Opal::Presentity::~Presentity ()
 {
-#if DEBUG
-    std::cout << __FUNCTION__ << " invoked in " << __FILE__ << std::endl;
-#endif
 }
 
 
diff --git a/lib/engine/components/opal/sip-call-manager.cpp b/lib/engine/components/opal/sip-call-manager.cpp
index c33010e..b12cb9b 100644
--- a/lib/engine/components/opal/sip-call-manager.cpp
+++ b/lib/engine/components/opal/sip-call-manager.cpp
@@ -35,6 +35,10 @@
  *
  */
 
+#if DEBUG
+#include <typeinfo>
+#include <iostream>
+#endif
 
 #include "config.h"
 
@@ -78,7 +82,7 @@ Opal::Sip::CallManager::CallManager (Ekiga::ServiceCore& _core,
 Opal::Sip::CallManager::~CallManager ()
 {
 #if DEBUG
-  std::cout << "Opal::Sip::CallManager: Destructor invoked" << std::endl;
+  std::cout << "Destroyed object of type " << typeid(*this).name () << std::endl;
 #endif
 }
 
diff --git a/lib/engine/framework/dynamic-object.h b/lib/engine/framework/dynamic-object.h
index 667a93f..e13bbf3 100644
--- a/lib/engine/framework/dynamic-object.h
+++ b/lib/engine/framework/dynamic-object.h
@@ -38,6 +38,11 @@
 #include <boost/smart_ptr.hpp>
 #include <boost/enable_shared_from_this.hpp>
 
+#if DEBUG
+#include <typeinfo>
+#include <iostream>
+#endif
+
 #include "menu-builder.h"
 
 namespace Ekiga
@@ -62,6 +67,12 @@ namespace Ekiga
        *  - The low-level implementation API (e.g. Ekiga::BookImpl<ContactType>)
        *
        */
+#if DEBUG
+      virtual ~DynamicObject ()
+      {
+        std::cout << "Destroyed object of type " << typeid(*this).name () << std::endl;
+      }
+#endif
 
       /**
        * Signals on that object
diff --git a/lib/engine/framework/services.cpp b/lib/engine/framework/services.cpp
index 7e7aa63..28a3117 100644
--- a/lib/engine/framework/services.cpp
+++ b/lib/engine/framework/services.cpp
@@ -104,10 +104,13 @@ Ekiga::ServiceCore::~ServiceCore ()
                << std::endl;
     }
   }
+
+  std::cout << "Destroyed object of type " << typeid(*this).name () << std::endl;
+
   if (count)
     std::cout << "  (which means " << count << " leaked services)" << std::endl;
   else
-    std::cout << "  (no service leaked)" << std::endl;
+    std::cout << "  (NO SERVICE LEAKED)" << std::endl;
 #endif
 }
 
diff --git a/lib/engine/gui/gtk-core/gtk-core.cpp b/lib/engine/gui/gtk-core/gtk-core.cpp
index 90b81a7..f4deaa2 100644
--- a/lib/engine/gui/gtk-core/gtk-core.cpp
+++ b/lib/engine/gui/gtk-core/gtk-core.cpp
@@ -32,8 +32,20 @@
  *
  */
 
+#if DEBUG
+#include <typeinfo>
+#include <iostream>
+#endif
+
 #include "gtk-core.h"
 
 Gtk::Core::Core ()
 {
 }
+
+Gtk::Core::~Core ()
+{
+#if DEBUG
+  std::cout << "Destroyed object of type " << typeid(*this).name () << std::endl;
+#endif
+}
diff --git a/lib/engine/gui/gtk-core/gtk-core.h b/lib/engine/gui/gtk-core/gtk-core.h
index 692dbca..508c816 100644
--- a/lib/engine/gui/gtk-core/gtk-core.h
+++ b/lib/engine/gui/gtk-core/gtk-core.h
@@ -46,8 +46,7 @@ namespace Gtk
 
     Core ();
 
-    ~Core ()
-    { }
+    ~Core ();
 
     const std::string get_name () const
     { return "gtk-core"; }
diff --git a/lib/engine/hal/hal-core.cpp b/lib/engine/hal/hal-core.cpp
index cc3cb52..871a3ef 100644
--- a/lib/engine/hal/hal-core.cpp
+++ b/lib/engine/hal/hal-core.cpp
@@ -33,6 +33,12 @@
  *
  */
 
+
+#if DEBUG
+#include <typeinfo>
+#include <iostream>
+#endif
+
 #include "hal-core.h"
 #include "hal-manager.h"
 
@@ -43,8 +49,12 @@ HalCore::HalCore ()
 {
 }
 
+
 HalCore::~HalCore ()
 {
+#if DEBUG
+  std::cout << "Destroyed object of type " << typeid(*this).name () << std::endl;
+#endif
 }
 
 
diff --git a/lib/engine/presence/presence-core.cpp b/lib/engine/presence/presence-core.cpp
index 34bf367..b2b5ca8 100644
--- a/lib/engine/presence/presence-core.cpp
+++ b/lib/engine/presence/presence-core.cpp
@@ -34,6 +34,11 @@
  *
  */
 
+#if DEBUG
+#include <typeinfo>
+#include <iostream>
+#endif
+
 #include "presence-core.h"
 #include "personal-details.h"
 
diff --git a/lib/engine/protocol/call-core.cpp b/lib/engine/protocol/call-core.cpp
index f2a2dae..4a20388 100644
--- a/lib/engine/protocol/call-core.cpp
+++ b/lib/engine/protocol/call-core.cpp
@@ -33,6 +33,11 @@
  *
  */
 
+#if DEBUG
+#include <typeinfo>
+#include <iostream>
+#endif
+
 #include "config.h"
 
 #include <glib/gi18n.h>
@@ -54,7 +59,7 @@ CallCore::CallCore (boost::shared_ptr<Ekiga::FriendOrFoe> _iff,
 CallCore::~CallCore ()
 {
 #if DEBUG
-  std::cout << "Ekiga::CallCore: Destructor invoked" << std::endl << std::flush;
+  std::cout << "Destroyed object of type " << typeid(*this).name () << std::endl;
 #endif
 }
 
diff --git a/lib/engine/videoinput/videoinput-core.cpp b/lib/engine/videoinput/videoinput-core.cpp
index 3fa13e6..5016f4b 100644
--- a/lib/engine/videoinput/videoinput-core.cpp
+++ b/lib/engine/videoinput/videoinput-core.cpp
@@ -33,7 +33,10 @@
  *
  */
 
+#if DEBUG
+#include <typeinfo>
 #include <iostream>
+#endif
 
 #include <glib/gi18n.h>
 
@@ -64,6 +67,10 @@ VideoInputCore::VideoPreviewManager::VideoPreviewManager (VideoInputCore& _video
 VideoInputCore::VideoPreviewManager::~VideoPreviewManager ()
 {
   quit ();
+
+#if DEBUG
+  std::cout << "Destroyed object of type " << typeid(*this).name () << std::endl;
+#endif
 }
 
 void VideoInputCore::VideoPreviewManager::quit ()
@@ -191,6 +198,7 @@ VideoInputCore::VideoInputCore (Ekiga::ServiceCore & _core,
   video_codecs_settings->changed.connect (boost::bind (&VideoInputCore::setup, this, _1));
 }
 
+
 VideoInputCore::~VideoInputCore ()
 {
   delete preview_manager;
@@ -206,10 +214,6 @@ VideoInputCore::~VideoInputCore ()
 
   delete device_settings;
   delete video_codecs_settings;
-
-#if DEBUG
-  std::cout << "Ekiga::VideoInputCore: Destructor invoked" << std::endl << std::flush;
-#endif
 }
 
 
diff --git a/lib/engine/videooutput/videooutput-core.cpp b/lib/engine/videooutput/videooutput-core.cpp
index 540807d..5a6037c 100644
--- a/lib/engine/videooutput/videooutput-core.cpp
+++ b/lib/engine/videooutput/videooutput-core.cpp
@@ -33,6 +33,11 @@
  *
  */
 
+#if DEBUG
+#include <typeinfo>
+#include <iostream>
+#endif
+
 #include "config.h"
 
 #include "videooutput-core.h"
@@ -49,6 +54,7 @@ VideoOutputCore::VideoOutputCore ()
   number_times_started = 0;
 }
 
+
 VideoOutputCore::~VideoOutputCore ()
 {
   PWaitAndSignal m(core_mutex);
@@ -61,7 +67,7 @@ VideoOutputCore::~VideoOutputCore ()
   managers.clear();
 
 #if DEBUG
-  std::cout << "Ekiga::VideoOutputCore: Destructor invoked" << std::endl << std::flush;
+  std::cout << "Destroyed object of type " << typeid(*this).name () << std::endl;
 #endif
 }
 
diff --git a/plugins/avahi/avahi-heap.cpp b/plugins/avahi/avahi-heap.cpp
index 31401c5..b495cb7 100644
--- a/plugins/avahi/avahi-heap.cpp
+++ b/plugins/avahi/avahi-heap.cpp
@@ -34,14 +34,12 @@
  *
  */
 
-#include <iostream>
 #include <cstdlib>
 #include <glib/gi18n.h>
 
 #include "avahi-presentity.h"
 #include "avahi-heap.h"
 
-#define DEBUG 0
 
 static void
 avahi_client_callback (AvahiClient *client,
@@ -192,11 +190,6 @@ Avahi::Heap::ClientCallback (AvahiClient *_client,
                               (AvahiLookupFlags)0,
                               avahi_browser_callback,
                               this);
-#if DEBUG
-    std::cout << __PRETTY_FUNCTION__ << " AVAHI_CLIENT_S_RUNNING" << std::endl;
-    if (browser == NULL)
-      std::cout << "but NULL browser!" << std::endl;
-#endif
     break;
   case AVAHI_CLIENT_CONNECTING:
   case AVAHI_CLIENT_S_REGISTERING:
diff --git a/plugins/evolution/evolution-book.cpp b/plugins/evolution/evolution-book.cpp
index 0a74879..e28d2c2 100644
--- a/plugins/evolution/evolution-book.cpp
+++ b/plugins/evolution/evolution-book.cpp
@@ -278,10 +278,6 @@ Evolution::Book::~Book ()
 {
   if (book != NULL)
     g_object_unref (book);
-
-#if DEBUG
-  std::cout << "Evolution::Book: Destructor invoked" << std::endl;
-#endif
 }
 
 const std::string
diff --git a/plugins/evolution/evolution-contact.cpp b/plugins/evolution/evolution-contact.cpp
index fdb553b..bdab791 100644
--- a/plugins/evolution/evolution-contact.cpp
+++ b/plugins/evolution/evolution-contact.cpp
@@ -35,14 +35,11 @@
  */
 
 #include <glib/gi18n.h>
-#include <iostream>
 
 #include "evolution-contact.h"
 #include "form-request-simple.h"
 #include "menu-builder-tools.h"
 
-#define DEBUG 1
-
 /* at one point we will return a smart pointer on this... and if we don't use
  * a false smart pointer, we will crash : the reference count isn't embedded!
  */
@@ -87,10 +84,6 @@ Evolution::Contact::Contact (Ekiga::ServiceCore &_services,
 
 Evolution::Contact::~Contact ()
 {
-#if DEBUG
-  std::cout << __FUNCTION__ << " invoked in " << __FILE__ << " for " << get_name () << std::endl << 
std::flush;
-#endif
-
   if (E_IS_CONTACT (econtact))
     g_object_unref (econtact);
 }
diff --git a/plugins/evolution/evolution-source.cpp b/plugins/evolution/evolution-source.cpp
index e124efe..bac0ee1 100644
--- a/plugins/evolution/evolution-source.cpp
+++ b/plugins/evolution/evolution-source.cpp
@@ -34,8 +34,6 @@
  *
  */
 
-#include <iostream>
-
 #include "config.h"
 
 #include "evolution-source.h"
@@ -231,9 +229,6 @@ Evolution::Source::~Source ()
 #else
   g_object_unref (source_list);
 #endif
-#if DEBUG
-  std::cout << "Evolution::Source: Destructor invoked" << std::endl;
-#endif
 }
 
 bool
diff --git a/plugins/ldap/ldap-book.cpp b/plugins/ldap/ldap-book.cpp
index bffca4e..eeabd21 100644
--- a/plugins/ldap/ldap-book.cpp
+++ b/plugins/ldap/ldap-book.cpp
@@ -402,9 +402,6 @@ OPENLDAP::Book::Book (Ekiga::ServiceCore &_core,
 
 OPENLDAP::Book::~Book ()
 {
-#if DEBUG
-  std::cout << __FUNCTION__ << " invoked in " << __FILE__ << std::endl << std::flush;
-#endif
 }
 
 bool
diff --git a/plugins/ldap/ldap-contact.cpp b/plugins/ldap/ldap-contact.cpp
index 8337c1b..19bf757 100644
--- a/plugins/ldap/ldap-contact.cpp
+++ b/plugins/ldap/ldap-contact.cpp
@@ -68,9 +68,6 @@ OPENLDAP::Contact::Contact (Ekiga::ServiceCore &_core,
 
 OPENLDAP::Contact::~Contact ()
 {
-#if DEBUG
-  std::cout << __FUNCTION__ << " invoked in " << __FILE__ << std::endl << std::flush;
-#endif
 }
 
 const std::string
diff --git a/plugins/ldap/ldap-source.cpp b/plugins/ldap/ldap-source.cpp
index 367528e..c9d3779 100644
--- a/plugins/ldap/ldap-source.cpp
+++ b/plugins/ldap/ldap-source.cpp
@@ -66,9 +66,6 @@ OPENLDAP::Source::Source (Ekiga::ServiceCore &_core):
 
 OPENLDAP::Source::~Source ()
 {
-#if DEBUG
-  std::cout << __FUNCTION__ << " invoked in " << __FILE__ << std::endl << std::flush;
-#endif
 }
 
 void


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