summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-11-30 23:15:49 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-11-30 23:15:49 +0000
commit2542b776c5128bee46528b4b6d6b342772594953 (patch)
tree9114fdf5f94c7cb6309afc84b4b793ab4ce7f46f /gtk2_ardour
parent54a96bb67521e3fc633babe6d9aea86113eb2c74 (diff)
clarify ownership and management of RouteUI::remote_control_menu
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4273 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/mixer_strip.cc7
-rw-r--r--gtk2_ardour/route_time_axis.cc5
-rw-r--r--gtk2_ardour/route_ui.cc19
3 files changed, 14 insertions, 17 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index 1b8ce06dda..d4f25d1896 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -1056,11 +1056,10 @@ MixerStrip::build_route_ops_menu ()
denormal_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
denormal_menu_item->set_active (_route->denormal_protection());
- build_remote_control_menu ();
-
- items.push_back (SeparatorElem());
if (!Profile->get_sae()) {
- items.push_back (MenuElem (_("Remote Control ID"), *remote_control_menu));
+ build_remote_control_menu ();
+ items.push_back (SeparatorElem());
+ items.push_back (MenuElem (_("Remote Control ID"), *remote_control_menu));
}
items.push_back (SeparatorElem());
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index aeb30b8a61..1a85ef0307 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -450,11 +450,10 @@ RouteTimeAxisView::build_display_menu ()
items.push_back (SeparatorElem());
- build_remote_control_menu ();
- build_automation_action_menu ();
-
if (!Profile->get_sae()) {
+ build_remote_control_menu ();
items.push_back (MenuElem (_("Remote Control ID"), *remote_control_menu));
+ build_automation_action_menu ();
items.push_back (MenuElem (_("Automation"), *automation_action_menu));
items.push_back (SeparatorElem());
}
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index efec686ed5..cc4f541385 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -114,11 +114,6 @@ RouteUI::reset ()
mute_menu = 0;
}
- if (remote_control_menu) {
- delete remote_control_menu;
- remote_control_menu = 0;
- }
-
if (xml_node) {
/* do not delete the node - its owned by the route */
xml_node = 0;
@@ -193,6 +188,7 @@ RouteUI::set_route (boost::shared_ptr<Route> rp)
RouteUI::~RouteUI()
{
GoingAway (); /* EMIT SIGNAL */
+
if (solo_menu) {
delete solo_menu;
}
@@ -200,10 +196,13 @@ RouteUI::~RouteUI()
if (mute_menu) {
delete mute_menu;
}
-
- if (remote_control_menu) {
- delete remote_control_menu;
- }
+
+ /* Note: the remote control menu is constructed
+ by derived classes (e.g. MixerStrip or RouteTimeAxis) and
+ is always attached to a context menu. It then becomes
+ owned by that menu, and will deleted along with it. We
+ do not need to take care of it here.
+ */
}
bool
@@ -941,7 +940,7 @@ gint
RouteUI::idle_remove_this_route (RouteUI *rui)
{
rui->_session.remove_route (rui->_route);
- return FALSE;
+ return false;
}
void