mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
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:
@@ -114,7 +114,11 @@ GroupBridge::~GroupBridge() {
|
|||||||
void GroupBridge::handle_plugin_dispatch(size_t plugin_id) {
|
void GroupBridge::handle_plugin_dispatch(size_t plugin_id) {
|
||||||
// At this point the `active_plugins` map will already contain the
|
// At this point the `active_plugins` map will already contain the
|
||||||
// intialized plugin's `Vst2Bridge` instance and this thread's handle
|
// 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
|
// Blocks this thread until the plugin shuts down, handling all events on
|
||||||
// the main IO context
|
// the main IO context
|
||||||
|
|||||||
Reference in New Issue
Block a user