mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Handle special case of using unmanaged widgets to Frame
This happens in in Ardour's Preference dialog with e.g. BufferingOptions: ~OptionEditorContainer deletes the Option, which in turn deletes the Widget BufferingOptions:_buffering_presets_combo Since the widget is not managed it is not removed from its parent. Later ~OptionEditorContainer disposes the page layout, which eventually also calls the Frame d'tor, causing a heap-use-after-free.
This commit is contained in:
parent
4cd241fab7
commit
28c8dbf128
2 changed files with 10 additions and 0 deletions
|
|
@ -64,6 +64,13 @@ Frame::~Frame ()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
Frame::child_destroyed (GtkWidget*, gpointer data)
|
||||
{
|
||||
Frame* self = static_cast<Frame*>(data);
|
||||
self->_w = 0;
|
||||
}
|
||||
|
||||
void
|
||||
Frame::on_add (Widget* w)
|
||||
{
|
||||
|
|
@ -73,6 +80,7 @@ Frame::on_add (Widget* w)
|
|||
|
||||
Bin::on_add (w);
|
||||
_w = w;
|
||||
g_signal_connect (w->gobj(), "destroy", G_CALLBACK(child_destroyed), this);
|
||||
queue_resize ();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ protected:
|
|||
void on_style_changed (const Glib::RefPtr<Gtk::Style>&);
|
||||
void on_name_changed ();
|
||||
|
||||
static void child_destroyed (GtkWidget*, gpointer);
|
||||
|
||||
private:
|
||||
Glib::RefPtr<Gtk::Style> get_parent_style ();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue