Fix crashes on increasing a bus' number of outputs.
authorCarl Hetherington <carl@carlh.net>
Sun, 13 Dec 2009 23:48:48 +0000 (23:48 +0000)
committerCarl Hetherington <carl@carlh.net>
Sun, 13 Dec 2009 23:48:48 +0000 (23:48 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@6364 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/panner.cc

index 85c8e403e94cfcc9d24d3b59befd99bbca248dc2..14f5a2038e1e3ac5081eb46a21cfc384d76d213a 100644 (file)
@@ -921,7 +921,10 @@ Panner::reset (uint32_t nouts, uint32_t npans)
 
        if (nouts < 2) {
                /* no need for panning with less than 2 outputs */
-               goto send_changed;
+               if (changed) {
+                       Changed (); /* EMIT SIGNAL */
+               }
+               return;
        }
 
        switch (nouts) {
@@ -999,6 +1002,14 @@ Panner::reset (uint32_t nouts, uint32_t npans)
                (*x)->update ();
        }
 
+       /* must emit Changed here, otherwise the changes to the pan_control below raise further
+          signals which the GUI is not prepared for until it has seen the Changed here.
+       */
+       
+       if (changed) {
+               Changed (); /* EMIT SIGNAL */
+       }
+
        /* force hard left/right panning in a common case: 2in/2out
        */
 
@@ -1021,17 +1032,8 @@ Panner::reset (uint32_t nouts, uint32_t npans)
 
                        _streampanners.back()->set_position (1.0);
                        _streampanners.back()->pan_control()->list()->reset_default (1.0);
-
-                       changed = true;
                }
        }
-
-  send_changed:
-       if (changed) {
-               Changed (); /* EMIT SIGNAL */
-       }
-
-       return;
 }
 
 void