summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-05-16 18:04:47 +0000
committerCarl Hetherington <carl@carlh.net>2010-05-16 18:04:47 +0000
commit20724294c281d63361d98c1ee255ef51f34a8557 (patch)
tree9ba18aa2e16c123858c10da7012577e01fb45c8b
parent2deba158635501e8f61363ab691882255ce5031c (diff)
Detach submenu before its parent is destroyed. Fixes #3134.
git-svn-id: svn://localhost/ardour2/branches/3.0@7106 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/midi_time_axis.cc12
1 files changed, 11 insertions, 1 deletions
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));