probable crash fix for solo-press causes segv
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 11 Oct 2008 16:29:42 +0000 (16:29 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 11 Oct 2008 16:29:42 +0000 (16:29 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3927 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/route_ui.cc

index fedb47c4c3f4406d0fef96bdd051f6a56a32820a..a529403f37c930fe88aec0936902db689eed632b 100644 (file)
@@ -88,8 +88,6 @@ RouteUI::init ()
        rec_enable_button = manage (new BindableToggleButton (0, ""));
        rec_enable_button->set_name ("RecordEnableButton");
        rec_enable_button->set_self_managed (true);
-       
-       _session.SoloChanged.connect (mem_fun(*this, &RouteUI::solo_changed_so_update_mute));
 }
 
 void
@@ -133,6 +131,11 @@ RouteUI::set_button_names (const char* mute, const char* solo, const char* rec)
 void
 RouteUI::set_route (boost::shared_ptr<Route> rp)
 {
+       if (!_route) {
+               /* first time it is set */
+               _session.SoloChanged.connect (mem_fun(*this, &RouteUI::solo_changed_so_update_mute));
+       }
+
        reset ();
 
        _route = rp;