From 316fed3c376d892de6dd85c21e53a5cc5a76f75a Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Thu, 26 Dec 2019 23:41:07 +0100 Subject: [PATCH] Create the plugin instance at the correct place Patch by @falkTX --- lv2/sfizz.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lv2/sfizz.c b/lv2/sfizz.c index f31c38f3..d5b15fe6 100644 --- a/lv2/sfizz.c +++ b/lv2/sfizz.c @@ -373,6 +373,7 @@ instantiate(const LV2_Descriptor *descriptor, return NULL; } + self->synth = sfizz_create_synth(); return (LV2_Handle)self; } @@ -380,6 +381,7 @@ static void cleanup(LV2_Handle instance) { sfizz_plugin_t *self = (sfizz_plugin_t *)instance; + sfizz_free(self->synth); free(self); } @@ -387,21 +389,14 @@ static void activate(LV2_Handle instance) { sfizz_plugin_t *self = (sfizz_plugin_t *)instance; - self->synth = sfizz_create_synth(); sfizz_set_samples_per_block(self->synth, self->max_block_size); sfizz_set_sample_rate(self->synth, self->sample_rate); - if (strlen(self->sfz_file_path) > 0) - { - lv2_log_note(&self->logger, "Current file is: %s\n", self->sfz_file_path); - sfizz_load_file(self->synth, self->sfz_file_path); - } } static void deactivate(LV2_Handle instance) { - sfizz_plugin_t *self = (sfizz_plugin_t *)instance; - sfizz_free(self->synth); + UNUSED(instance); } static void