diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-07-01 16:35:46 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-07-01 17:47:05 -0400 |
commit | ba700ecc63f2462684a43b62157e228aa71be1cb (patch) | |
tree | cb3cd5db5418689390579caf6521e0b1ee0f58a0 /libs/pbd | |
parent | 47144ee7f44b3e9cf96c573167085ab1732746dd (diff) |
add the potential for a bit more debugging of signal connects
Diffstat (limited to 'libs/pbd')
-rw-r--r-- | libs/pbd/pbd/signals.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/libs/pbd/pbd/signals.py b/libs/pbd/pbd/signals.py index 9495b70f89..fbcf1d4016 100644 --- a/libs/pbd/pbd/signals.py +++ b/libs/pbd/pbd/signals.py @@ -268,11 +268,17 @@ def signal(f, n, v): print("\t}", file=f) print(""" - bool empty () { + bool empty () const { Glib::Threads::Mutex::Lock lm (_mutex); return _slots.empty (); } """, file=f) + print(""" + bool size () const { + Glib::Threads::Mutex::Lock lm (_mutex); + return _slots.size (); + } +""", file=f) if v: tp = comma_separated(["void"] + An) @@ -286,14 +292,15 @@ def signal(f, n, v): print(""" boost::shared_ptr<Connection> _connect (slot_function_type f) { + boost::shared_ptr<Connection> c (new Connection (this)); + Glib::Threads::Mutex::Lock lm (_mutex); + _slots[c] = f; #ifdef DEBUG_PBD_SIGNAL_CONNECTIONS if (_debug_connection) { + std::cerr << "+++++++ CONNECT " << this << " size now " << _slots.size() << std::endl; PBD::stacktrace (std::cerr, 10); } #endif - boost::shared_ptr<Connection> c (new Connection (this)); - Glib::Threads::Mutex::Lock lm (_mutex); - _slots[c] = f; return c; }""", file=f) @@ -302,6 +309,12 @@ def signal(f, n, v): { Glib::Threads::Mutex::Lock lm (_mutex); _slots.erase (c); +#ifdef DEBUG_PBD_SIGNAL_CONNECTIONS + if (_debug_connection) { + std::cerr << "------- DISCCONNECT " << this << " size now " << _slots.size() << std::endl; + PBD::stacktrace (std::cerr, 10); + } +#endif } }; """, file=f) |