mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
Amend 28c8dbf128, unsubscribe from destroyed signal
This handles another edge case where the Frame is deleted before the child widget.
This commit is contained in:
parent
15fd52960e
commit
c4020b22c4
2 changed files with 10 additions and 1 deletions
|
|
@ -60,6 +60,8 @@ Frame::~Frame ()
|
|||
_parent_style_change.disconnect ();
|
||||
}
|
||||
if (_w) {
|
||||
g_signal_handler_disconnect (_w->gobj(), _destroy_connection);
|
||||
/* This is manly for the benefit of macOS GLCanvas (see also EventBoxExt) */
|
||||
_w->unparent ();
|
||||
}
|
||||
}
|
||||
|
|
@ -68,6 +70,7 @@ void
|
|||
Frame::child_destroyed (GtkWidget*, gpointer data)
|
||||
{
|
||||
Frame* self = static_cast<Frame*>(data);
|
||||
g_signal_handler_disconnect (self->_w->gobj(), self->_destroy_connection);
|
||||
self->_w = 0;
|
||||
}
|
||||
|
||||
|
|
@ -80,7 +83,8 @@ Frame::on_add (Widget* w)
|
|||
|
||||
Bin::on_add (w);
|
||||
_w = w;
|
||||
g_signal_connect (w->gobj(), "destroy", G_CALLBACK(child_destroyed), this);
|
||||
|
||||
_destroy_connection = g_signal_connect_after (w->gobj(), "destroy", G_CALLBACK(child_destroyed), this);
|
||||
queue_resize ();
|
||||
}
|
||||
|
||||
|
|
@ -89,6 +93,9 @@ Frame::on_remove (Gtk::Widget* w)
|
|||
{
|
||||
Bin::on_remove (w);
|
||||
assert (_w == w);
|
||||
if (_w) {
|
||||
g_signal_handler_disconnect (_w->gobj(), _destroy_connection);
|
||||
}
|
||||
_w = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -81,6 +81,8 @@ private:
|
|||
int _alloc_y0;
|
||||
bool _boxy;
|
||||
bool _draw;
|
||||
|
||||
gulong _destroy_connection;
|
||||
};
|
||||
|
||||
} // namespace ArdourWidgets
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue