smbolton / hexter

Yamaha DX7 modeling DSSI soft synth
http://dssi.sourceforge.net/hexter.html
GNU General Public License v2.0
109 stars 15 forks source link

hexter_cleanup fix #3

Closed rncbc closed 10 years ago

rncbc commented 10 years ago

below a simple diff-patch to hexter.c/hexter_cleanup() which fixes DSSI multi-instance removal from crashing eg. qtractor.

+++ a/src/hexter.c  2012-10-23 07:40:41.000000000 +0100
--- b/src/hexter.c  2014-06-06 19:00:00.000000000 +0100
@@ -242,7 +242,6 @@ hexter_cleanup(LADSPA_Handle handle)
         hexter_deactivate(instance);

         if (instance->patches) free(instance->patches);
-        free(instance);

         prev = NULL;
         for (inst = hexter_synth.instances; inst; inst = inst->next) {
@@ -256,6 +256,7 @@ hexter_cleanup(LADSPA_Handle handle)
             prev = inst;
         }
         hexter_synth.instance_count--;
+        free(instance);
     }

     if (!hexter_synth.instance_count && hexter_synth.initialized) {