From 20724294c281d63361d98c1ee255ef51f34a8557 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 16 May 2010 18:04:47 +0000 Subject: [PATCH] Detach submenu before its parent is destroyed. Fixes #3134. git-svn-id: svn://localhost/ardour2/branches/3.0@7106 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/midi_time_axis.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 51c4f3b0ed..4843b1875f 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -377,6 +377,17 @@ MidiTimeAxisView::build_automation_action_menu () { using namespace Menu_Helpers; + /* If we have a controller menu, we need to detach it before + RouteTimeAxis::build_automation_action_menu destroys the + menu it is attached to. Otherwise GTK destroys + controller_menu's gobj, meaning that it can't be reattached + below. See bug #3134. + */ + + if (controller_menu) { + detach_menu (*controller_menu); + } + RouteTimeAxisView::build_automation_action_menu (); MenuList& automation_items = automation_action_menu->items(); @@ -403,7 +414,6 @@ MidiTimeAxisView::build_automation_action_menu () */ build_controller_menu (); - detach_menu (*controller_menu); automation_items.push_back (SeparatorElem()); automation_items.push_back (MenuElem (_("Controllers"), *controller_menu));