diff --git a/jvsthost2.dll b/jvsthost2.dll index c09e326..b6b1210 100755 Binary files a/jvsthost2.dll and b/jvsthost2.dll differ diff --git a/src/com/synthbot/audioplugin/vst/vst2/JVstHost.cpp b/src/com/synthbot/audioplugin/vst/vst2/JVstHost.cpp index 18b741b..818d76c 100755 --- a/src/com/synthbot/audioplugin/vst/vst2/JVstHost.cpp +++ b/src/com/synthbot/audioplugin/vst/vst2/JVstHost.cpp @@ -788,7 +788,6 @@ JNIEXPORT void JNICALL Java_com_synthbot_audioplugin_vst_vst2_JVstHost2_unloadPl (JNIEnv *env, jclass jclazz, jlong ae) { if (ae != 0) { - AEffect *effect = (AEffect *)ae; if (isHostLocalVarsValid(effect)) { @@ -801,10 +800,12 @@ JNIEXPORT void JNICALL Java_com_synthbot_audioplugin_vst_vst2_JVstHost2_unloadPl if (hostVars->vti != 0) { free(hostVars->vti); } + free(hostVars); + effect->resvd1 = NULL; // close the plugin effect->dispatcher (effect, effClose, 0, 0, 0, 0); - + // close the library from which the plugin was loaded if (libPtr != 0) { #if _WIN32 diff --git a/src/com/synthbot/audioplugin/vst/vst2/JVstHost2.java b/src/com/synthbot/audioplugin/vst/vst2/JVstHost2.java index b43d11e..cb57b32 100644 --- a/src/com/synthbot/audioplugin/vst/vst2/JVstHost2.java +++ b/src/com/synthbot/audioplugin/vst/vst2/JVstHost2.java @@ -134,6 +134,11 @@ protected synchronized void finalize() throws Throwable { System.loadLibrary("jvsthost2"); } + @Override + public String toString() { + return getEffectName() + "@0x" + Long.toHexString(vstPluginPtr); + } + /** * Indicates if the native component of the plugin is loaded. Any use of the * JVstHost2 object while the plugin is not loaded will throw an IllegalStateException.