diff options
author | Robin Gareus <robin@gareus.org> | 2019-03-07 16:40:16 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-03-07 23:50:32 +0100 |
commit | 3bc9281c312ec237b6365c023c5ef060f5788a6b (patch) | |
tree | 12969680c5f11c2216bc3746f701c6906f8a2b21 /gtk2_ardour/midi_time_axis.cc | |
parent | 204d7bf76ccccadea68a7bd3c8797b451a5c2971 (diff) |
Fix some Gtk::Menu related 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.
This adds explicit delete calls for menus where there is a
member variable reference to the Menu.
Diffstat (limited to 'gtk2_ardour/midi_time_axis.cc')
-rw-r--r-- | gtk2_ardour/midi_time_axis.cc | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index f64caaf271..4cad0fb8be 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -550,10 +550,7 @@ MidiTimeAxisView::append_extra_display_menu_items () items.push_back (MenuElem (_("Patch Selector..."), sigc::mem_fun(*this, &RouteUI::select_midi_patch))); - color_mode_menu = build_color_mode_menu(); - if (color_mode_menu) { - items.push_back (MenuElem (_("Color Mode"), *color_mode_menu)); - } + items.push_back (MenuElem (_("Color Mode"), *build_color_mode_menu ())); items.push_back (SeparatorElem ()); } |