Add a missing lock to reading from active_plugins

I've never seen this cause memory errors, but there exist a rare
situation where it could.
This commit is contained in:
Robbert van der Helm
2020-10-26 12:45:38 +01:00
parent 2f6883977f
commit 523ac64d11
+5 -1
View File
@@ -114,7 +114,11 @@ GroupBridge::~GroupBridge() {
void GroupBridge::handle_plugin_dispatch(size_t plugin_id) {
// At this point the `active_plugins` map will already contain the
// intialized plugin's `Vst2Bridge` instance and this thread's handle
auto& [thread, bridge] = active_plugins[plugin_id];
Vst2Bridge* bridge;
{
std::lock_guard lock(active_plugins_mutex);
bridge = active_plugins[plugin_id].second.get();
}
// Blocks this thread until the plugin shuts down, handling all events on
// the main IO context