Free things properly in cleanup

This commit is contained in:
Nick Lanham 2012-02-07 21:30:32 +01:00
parent 7e857abd89
commit c31bea22f5

6
drmr.c
View File

@ -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);
}