Fix crash.
authorCarl Hetherington <carl@carlh.net>
Sat, 11 Dec 2010 00:23:39 +0000 (00:23 +0000)
committerCarl Hetherington <carl@carlh.net>
Sat, 11 Dec 2010 00:23:39 +0000 (00:23 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8241 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/panner.cc

index 0d86bb8db131e46b665ece1af425220172a7fa6c..0727f5454a65e4e6576ddfb3b220eb2176d11e45 100644 (file)
@@ -1502,15 +1502,15 @@ Panner::setup_meta_controls ()
         
         Evoral::Parameter lr_param (PanAutomation, 0, 100);
         Evoral::Parameter width_param (PanAutomation, 0, 200);
-        boost::shared_ptr<AutomationControl> wc;
-        boost::shared_ptr<AutomationControl> dc;
+        boost::shared_ptr<AutomationControl> dc = automation_control (lr_param);
+        boost::shared_ptr<AutomationControl> wc = automation_control (width_param);
 
-        if (!automation_control (lr_param)) {
+        if (!dc) {
                 dc.reset (new StreamPanner::PanControllable (_session, _("lr"), *_streampanners.front(), lr_param));
                 add_control (dc);
         }
         
-        if (!automation_control (width_param)) {
+        if (!wc) {
                 wc.reset (new StreamPanner::PanControllable (_session, _("width"), *_streampanners.front(), width_param));
                 add_control (wc);
         }