mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
add the potential for a bit more debugging of signal connects
This commit is contained in:
parent
47144ee7f4
commit
ba700ecc63
1 changed files with 19 additions and 6 deletions
|
|
@ -268,11 +268,17 @@ def signal(f, n, v):
|
||||||
print("\t}", file=f)
|
print("\t}", file=f)
|
||||||
|
|
||||||
print("""
|
print("""
|
||||||
bool empty () {
|
bool empty () const {
|
||||||
Glib::Threads::Mutex::Lock lm (_mutex);
|
Glib::Threads::Mutex::Lock lm (_mutex);
|
||||||
return _slots.empty ();
|
return _slots.empty ();
|
||||||
}
|
}
|
||||||
""", file=f)
|
""", file=f)
|
||||||
|
print("""
|
||||||
|
bool size () const {
|
||||||
|
Glib::Threads::Mutex::Lock lm (_mutex);
|
||||||
|
return _slots.size ();
|
||||||
|
}
|
||||||
|
""", file=f)
|
||||||
|
|
||||||
if v:
|
if v:
|
||||||
tp = comma_separated(["void"] + An)
|
tp = comma_separated(["void"] + An)
|
||||||
|
|
@ -286,14 +292,15 @@ def signal(f, n, v):
|
||||||
print("""
|
print("""
|
||||||
boost::shared_ptr<Connection> _connect (slot_function_type f)
|
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));
|
boost::shared_ptr<Connection> c (new Connection (this));
|
||||||
Glib::Threads::Mutex::Lock lm (_mutex);
|
Glib::Threads::Mutex::Lock lm (_mutex);
|
||||||
_slots[c] = f;
|
_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;
|
return c;
|
||||||
}""", file=f)
|
}""", file=f)
|
||||||
|
|
||||||
|
|
@ -302,6 +309,12 @@ def signal(f, n, v):
|
||||||
{
|
{
|
||||||
Glib::Threads::Mutex::Lock lm (_mutex);
|
Glib::Threads::Mutex::Lock lm (_mutex);
|
||||||
_slots.erase (c);
|
_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)
|
""", file=f)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue