diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index f172143547..6944e05bca 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -2430,9 +2430,6 @@ AudioRegion::apply_region_fx (BufferSet& bufs, samplepos_t start_sample, samplep } } - ARDOUR::ProcessThread* pt = new ProcessThread (); // TODO -> move to butler ? - pt->get_buffers (); - samplecnt_t latency_offset = 0; for (auto const& rfx : _plugins) { @@ -2470,6 +2467,4 @@ AudioRegion::apply_region_fx (BufferSet& bufs, samplepos_t start_sample, samplep } _fx_pos = end_sample; _fx_latent_read = false; - pt->drop_buffers (); - delete pt; } diff --git a/libs/ardour/butler.cc b/libs/ardour/butler.cc index 8c76c9b084..039d1aef00 100644 --- a/libs/ardour/butler.cc +++ b/libs/ardour/butler.cc @@ -172,7 +172,12 @@ Butler::_thread_work (void* arg) { SessionEvent::create_per_thread_pool ("butler events", 4096); pthread_set_name (X_("butler")); - return ((Butler*)arg)->thread_work (); + ARDOUR::ProcessThread* pt = new ProcessThread (); + pt->get_buffers (); + void* rv = ((Butler*)arg)->thread_work (); + pt->drop_buffers (); + delete pt; + return rv; } void*