Check whether LoadLibrary has failed

Because that too can happen.
This commit is contained in:
Robbert van der Helm
2020-02-28 22:45:09 +01:00
parent e598d7c133
commit 7b7e2e2c21
+4
View File
@@ -14,6 +14,10 @@ Bridge::Bridge(std::string plugin_dll_path, std::string socket_endpoint_path)
socket_endpoint(socket_endpoint_path), socket_endpoint(socket_endpoint_path),
host_vst_dispatch(io_context) { host_vst_dispatch(io_context) {
// Got to love these C APIs // Got to love these C APIs
if (plugin_handle == nullptr) {
throw std::runtime_error("Could not load a shared library at '" +
plugin_dll_path + "'.");
}
// VST plugin entry point functions should be called `VSTPluginMain`, but // VST plugin entry point functions should be called `VSTPluginMain`, but
// there are some older deprecated names that legacy plugins may still use // there are some older deprecated names that legacy plugins may still use