shithub: sox

Download patch

ref: f611e818b11648904a295d467ec2fbca934cdc5b
parent: 985b1f4df599e890bd7a02403918294fd95be8b9
author: Eric Wong <normalperson@yhbt.net>
date: Sun Jun 10 02:53:26 EDT 2012

ladspa: call cleanup function if given

Some plugins have cleanup functions to deallocate memory after
instantiation.  This must be called after deactivate.

--- a/src/ladspa.c
+++ b/src/ladspa.c
@@ -285,6 +285,9 @@
   /* If needed, deactivate the plugin */
   if (l_st->desc->deactivate)
     l_st->desc->deactivate(l_st->handle);
+  /* If needed, cleanup memory used by the plugin */
+  if (l_st->desc->cleanup)
+    l_st->desc->cleanup(l_st->handle);
 
   return SOX_SUCCESS;
 }