Fix crash when going from >2 outputs (2D panner) to <= 2 outputs.
authorCarl Hetherington <carl@carlh.net>
Tue, 22 Dec 2009 01:09:50 +0000 (01:09 +0000)
committerCarl Hetherington <carl@carlh.net>
Tue, 22 Dec 2009 01:09:50 +0000 (01:09 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@6380 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/panner_ui.cc
gtk2_ardour/panner_ui.h
libs/ardour/panner.cc

index 0d2297383c4fcc1bb3efde306f33dcc4d9b4ac4b..e58af02f9b49f872cfc9046396d6025125091c08 100644 (file)
@@ -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 ();
index de889471aad9fe3a80c979ac3a92db90c115e8ee..a24b8f02c3ac8d9b163dbfc1c2f60d308b186a6b 100644 (file)
@@ -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;
index 14f5a2038e1e3ac5081eb46a21cfc384d76d213a..8ece75e55133e7aa0c3b81cee2633efb11e77906 100644 (file)
@@ -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.
        */