summaryrefslogtreecommitdiff
path: root/libs/ardour/vst_info_file.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-03-08 18:27:30 +0100
committerRobin Gareus <robin@gareus.org>2014-03-08 18:27:30 +0100
commit732d58ba811e1058fb7aaed06cc2a7b0f37f1aa3 (patch)
treebddbdefa95050e75adf7f7e4ee7ab2538419b958 /libs/ardour/vst_info_file.cc
parentcf1363a4a9376dad356042d2fd08fa34853db840 (diff)
fix double-free() when scanning VST shell plugins
Diffstat (limited to 'libs/ardour/vst_info_file.cc')
-rw-r--r--libs/ardour/vst_info_file.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/libs/ardour/vst_info_file.cc b/libs/ardour/vst_info_file.cc
index ec1223c11c..1aca4d6d3b 100644
--- a/libs/ardour/vst_info_file.cc
+++ b/libs/ardour/vst_info_file.cc
@@ -740,6 +740,16 @@ vstfx_info_from_plugin (const char *dllpath, VSTState* vstfx, vector<VSTInfo *>
}
}
}
+ } else {
+ switch(type) {
+#ifdef WINDOWS_VST_SUPPORT
+ case ARDOUR::Windows_VST: fst_close(vstfx); break;
+#endif
+#ifdef LXVST_SUPPORT
+ case ARDOUR::LXVST: vstfx_close (vstfx); break;
+#endif
+ default: assert(0); break;
+ }
}
#endif
}
@@ -772,7 +782,6 @@ vstfx_instantiate_and_get_info_lx (
vstfx_info_from_plugin(dllpath, vstfx, infos, ARDOUR::LXVST);
- vstfx_close (vstfx);
vstfx_unload (h);
return true;
}
@@ -802,8 +811,6 @@ vstfx_instantiate_and_get_info_fst (
vstfx_info_from_plugin(dllpath, vstfx, infos, ARDOUR::Windows_VST);
- fst_close(vstfx);
- //fst_unload(&h); // XXX -> fst_close()
return true;
}
#endif