From c31bea22f51f5e91f5731dda9b2c34701563205e Mon Sep 17 00:00:00 2001 From: Nick Lanham Date: Tue, 7 Feb 2012 21:30:32 +0100 Subject: [PATCH] Free things properly in cleanup --- drmr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drmr.c b/drmr.c index bbe90cc..9ffca42 100644 --- a/drmr.c +++ b/drmr.c @@ -289,6 +289,12 @@ static void run(LV2_Handle instance, uint32_t n_samples) { static void deactivate(LV2_Handle instance) {} static void cleanup(LV2_Handle instance) { + DrMr* drmr = (DrMr*)instance; + pthread_cancel(drmr->load_thread); + pthread_join(drmr->load_thread, 0); + if (drmr->num_samples > 0) + free_samples(drmr->samples,drmr->num_samples); + free(drmr->gains); free(instance); }