From 383b24cc48e542d83fca90d4263f800b33d69402 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 13 Dec 2009 23:48:48 +0000 Subject: Fix crashes on increasing a bus' number of outputs. git-svn-id: svn://localhost/ardour2/branches/3.0@6364 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/panner.cc | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'libs/ardour/panner.cc') diff --git a/libs/ardour/panner.cc b/libs/ardour/panner.cc index 85c8e403e9..14f5a2038e 100644 --- a/libs/ardour/panner.cc +++ b/libs/ardour/panner.cc @@ -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 -- cgit v1.2.3