diff options
author | Robin Gareus <robin@gareus.org> | 2019-03-07 17:02:12 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-03-07 23:50:50 +0100 |
commit | 7b96fa1c5e99e054f43ca3272d21ae955bfa3443 (patch) | |
tree | 67f2e5efd9ce1890ad3a6444cb114341576d26d3 /gtk2_ardour/ardour_ui.h | |
parent | 12a415f0772048f8a38a66a037b024223bc7bbc0 (diff) |
Fix some Gtk::Menu memory leaks
A Gtk::manage()d widget will be deleted when its parent container
is destroyed. Top-level context menus are not inside a container and
hence need to be manually deallocated.
The solution here is to use a shared Gtk::Menu pointer that is
centrally de/re-allocated.
This works because the GUI is single-threaded and at most one
context menu is visible at a time.
Diffstat (limited to 'gtk2_ardour/ardour_ui.h')
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index db6b30fd60..8ff4c3685f 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -228,6 +228,8 @@ public: PublicEditor& the_editor() { return *editor;} Mixer_UI* the_mixer() { return mixer; } + Gtk::Menu* shared_popup_menu (); + void new_midi_tracer_window (); void toggle_editing_space(); void toggle_mixer_space(); @@ -401,6 +403,8 @@ private: bool _mixer_on_top; bool _initial_verbose_plugin_scan; + Gtk::Menu* _shared_popup_menu; + void hide_tabbable (ArdourWidgets::Tabbable*); void detach_tabbable (ArdourWidgets::Tabbable*); void attach_tabbable (ArdourWidgets::Tabbable*); @@ -555,8 +559,6 @@ private: void transport_rec_enable_blink (bool onoff); - Gtk::Menu* session_popup_menu; - /* menu bar and associated stuff */ Gtk::MenuBar* menu_bar; |