mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Prevent duplicate signal emission
Re-assigning a sigc::connection does not disconnect any previously connected signals. WindowProxy::setup may be called multiple times. Notably plugin windows can change the managed _window (generic/custom), which requires a call to setup.
This commit is contained in:
parent
0dc4f4bf45
commit
f89845e64a
1 changed files with 5 additions and 0 deletions
|
|
@ -229,6 +229,11 @@ WindowProxy::setup ()
|
||||||
|
|
||||||
assert (_window);
|
assert (_window);
|
||||||
|
|
||||||
|
delete_connection.disconnect ();
|
||||||
|
configure_connection.disconnect ();
|
||||||
|
map_connection.disconnect ();
|
||||||
|
unmap_connection.disconnect ();
|
||||||
|
|
||||||
delete_connection = _window->signal_delete_event().connect (sigc::mem_fun (*this, &WindowProxy::delete_event_handler));
|
delete_connection = _window->signal_delete_event().connect (sigc::mem_fun (*this, &WindowProxy::delete_event_handler));
|
||||||
configure_connection = _window->signal_configure_event().connect (sigc::mem_fun (*this, &WindowProxy::configure_handler), false);
|
configure_connection = _window->signal_configure_event().connect (sigc::mem_fun (*this, &WindowProxy::configure_handler), false);
|
||||||
map_connection = _window->signal_map().connect (sigc::mem_fun (*this, &WindowProxy::map_handler), false);
|
map_connection = _window->signal_map().connect (sigc::mem_fun (*this, &WindowProxy::map_handler), false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue