13
0

add the potential for a bit more debugging of signal connects

This commit is contained in:
Paul Davis 2016-07-01 16:35:46 -04:00
parent 47144ee7f4
commit ba700ecc63

View File

@ -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)
{
#ifdef DEBUG_PBD_SIGNAL_CONNECTIONS
if (_debug_connection) {
PBD::stacktrace (std::cerr, 10);
}
#endif
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
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)