Fix SesionhandlRef when rebuilding peak-files
Since rebuilding peaks does not call drop-references, the WaveView is not explicitly released. and ArdourWaveView::WaveView keeps a shared pointer reference to the AudioRegion. This also fixes a memory leak, waves, tmp_waves store C++ pointers, not shared pointers. Explicit delete is required
This commit is contained in:
parent
7701e5ecb9
commit
070d8f5ee1
@ -1156,9 +1156,14 @@ AudioRegionView::delete_waves ()
|
|||||||
|
|
||||||
for (vector<ArdourWaveView::WaveView*>::iterator w = waves.begin(); w != waves.end(); ++w) {
|
for (vector<ArdourWaveView::WaveView*>::iterator w = waves.begin(); w != waves.end(); ++w) {
|
||||||
group->remove(*w);
|
group->remove(*w);
|
||||||
|
delete *w;
|
||||||
}
|
}
|
||||||
waves.clear();
|
waves.clear();
|
||||||
tmp_waves.clear();
|
|
||||||
|
while (!tmp_waves.empty ()) {
|
||||||
|
delete tmp_waves.back ();
|
||||||
|
tmp_waves.pop_back ();
|
||||||
|
}
|
||||||
pending_peak_data->show ();
|
pending_peak_data->show ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1304,8 +1309,12 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
|
|||||||
/* all waves are ready */
|
/* all waves are ready */
|
||||||
tmp_waves.resize(nwaves);
|
tmp_waves.resize(nwaves);
|
||||||
|
|
||||||
waves = tmp_waves;
|
waves.swap(tmp_waves);
|
||||||
tmp_waves.clear ();
|
|
||||||
|
while (!tmp_waves.empty ()) {
|
||||||
|
delete tmp_waves.back ();
|
||||||
|
tmp_waves.pop_back ();
|
||||||
|
}
|
||||||
|
|
||||||
/* indicate peak-completed */
|
/* indicate peak-completed */
|
||||||
pending_peak_data->hide ();
|
pending_peak_data->hide ();
|
||||||
|
Loading…
Reference in New Issue
Block a user