summaryrefslogtreecommitdiff
path: root/libs/pbd/pbd/signals.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-09-11 12:00:35 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-09-11 12:04:14 -0400
commit56f4e1513e9bd3efa3afb9061a8252fbd38933ee (patch)
treee2e3064d53af1724c7b9bf1f265f0a7b425c0066 /libs/pbd/pbd/signals.h
parent5dd5bb783072d0ed90e4bd71f8f20acd10802ac8 (diff)
provide compile-time-enabled/disabled debugging of connections being made to PBD::Signal via PBD::SignalBase::set_debug_connection()
Diffstat (limited to 'libs/pbd/pbd/signals.h')
-rw-r--r--libs/pbd/pbd/signals.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/pbd/pbd/signals.h b/libs/pbd/pbd/signals.h
index 672dc66850..ef53770613 100644
--- a/libs/pbd/pbd/signals.h
+++ b/libs/pbd/pbd/signals.h
@@ -39,6 +39,13 @@
#include "pbd/libpbd_visibility.h"
#include "pbd/event_loop.h"
+#define DEBUG_PBD_SIGNAL_CONNECTIONS
+
+#ifdef DEBUG_PBD_SIGNAL_CONNECTIONS
+#include "pbd/stacktrace.h"
+#include <iostream>
+#endif
+
namespace PBD {
class LIBPBD_API Connection;
@@ -46,11 +53,18 @@ class LIBPBD_API Connection;
class LIBPBD_API SignalBase
{
public:
+ SignalBase () : _debug_connection (false) {}
virtual ~SignalBase () {}
virtual void disconnect (boost::shared_ptr<Connection>) = 0;
+#ifdef DEBUG_PBD_SIGNAL_CONNECTIONS
+ void set_debug_connection (bool yn) { _debug_connection = yn; }
+#endif
protected:
Glib::Threads::Mutex _mutex;
+#ifdef DEBUG_PBD_SIGNAL_CONNECTIONS
+ bool _debug_connection;
+#endif
};
class LIBPBD_API Connection : public boost::enable_shared_from_this<Connection>