From 06f094d4b64a826ddd71c970aaa1679867a75975 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 22 Dec 2009 01:09:50 +0000 Subject: [PATCH] Fix crash when going from >2 outputs (2D panner) to <= 2 outputs. git-svn-id: svn://localhost/ardour2/branches/3.0@6380 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/panner_ui.cc | 10 ++++++++-- gtk2_ardour/panner_ui.h | 2 +- libs/ardour/panner.cc | 2 -- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/panner_ui.cc b/gtk2_ardour/panner_ui.cc index 0d2297383c..e58af02f9b 100644 --- a/gtk2_ardour/panner_ui.cc +++ b/gtk2_ardour/panner_ui.cc @@ -358,6 +358,9 @@ PannerUI::setup_pan () pan_adjustments.pop_back (); } + delete panner; + panner = 0; + /* stick something into the panning viewport so that it redraws */ EventBox* eb = manage (new EventBox()); @@ -376,6 +379,9 @@ PannerUI::setup_pan () pan_adjustments.pop_back (); } + delete panner; + panner = 0; + while ((asz = pan_adjustments.size()) < npans) { float x, rx; @@ -447,8 +453,8 @@ PannerUI::setup_pan () panner->set_name ("MixerPanZone"); panner->show (); - panner->signal_button_press_event().connect - (sigc::bind (sigc::mem_fun(*this, &PannerUI::pan_button_event), (uint32_t) 0), false); + panner->signal_button_press_event().connect + (sigc::bind (sigc::mem_fun(*this, &PannerUI::pan_button_event), (uint32_t) 0), false); } update_pan_sensitive (); diff --git a/gtk2_ardour/panner_ui.h b/gtk2_ardour/panner_ui.h index de889471aa..a24b8f02c3 100644 --- a/gtk2_ardour/panner_ui.h +++ b/gtk2_ardour/panner_ui.h @@ -91,7 +91,7 @@ class PannerUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr static const int pan_bar_height; - Panner2d* panner; + Panner2d* panner; ///< 2D panner, or 0 Panner2dWindow* big_window; Gtk::VBox pan_bar_packer; diff --git a/libs/ardour/panner.cc b/libs/ardour/panner.cc index 14f5a2038e..8ece75e551 100644 --- a/libs/ardour/panner.cc +++ b/libs/ardour/panner.cc @@ -894,8 +894,6 @@ Panner::reset (uint32_t nouts, uint32_t npans) bool changed = false; bool do_not_and_did_not_need_panning = ((nouts < 2) && (outputs.size() < 2)); - //cout << "Reset panner for " << nouts << " " << npans << "\n"; - /* if new and old config don't need panning, or if the config hasn't changed, we're done. */