properly disconnect peak-ready connection
authorRobin Gareus <robin@gareus.org>
Sun, 6 Sep 2015 10:56:50 +0000 (12:56 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 6 Sep 2015 10:56:50 +0000 (12:56 +0200)
gtk2_ardour/audio_region_view.cc

index bbee73c115454937e704989961cbf42780b2d777..b0ca3ff8afc017f9c392c03745ae38c9c9266574 100644 (file)
@@ -251,6 +251,7 @@ AudioRegionView::~AudioRegionView ()
        for (vector<ScopedConnection*>::iterator i = _data_ready_connections.begin(); i != _data_ready_connections.end(); ++i) {
                delete *i;
        }
+       _data_ready_connections.clear ();
 
        for (list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator i = feature_lines.begin(); i != feature_lines.end(); ++i) {
                delete ((*i).second);
@@ -1210,10 +1211,11 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
                waves = tmp_waves;
                tmp_waves.clear ();
 
-               /* all waves created, don't hook into peaks ready anymore */
-               delete _data_ready_connections[which];
-               _data_ready_connections[which] = 0;
        }
+
+       /* channel wave created, don't hook into peaks ready anymore */
+       delete _data_ready_connections[which];
+       _data_ready_connections[which] = 0;
 }
 
 void