Add missing lock to gLoadedData access

This commit is contained in:
Maschell 2024-03-23 21:16:27 +01:00
parent d2adc304f0
commit 9e4930acec

View File

@ -74,7 +74,10 @@ extern "C" PluginBackendApiErrorType WUPSLoadPluginAsData(WUPSBackendGetPluginIn
return PLUGIN_BACKEND_API_ERROR_FAILED_ALLOC; return PLUGIN_BACKEND_API_ERROR_FAILED_ALLOC;
} else { } else {
*out = pluginData->getHandle(); *out = pluginData->getHandle();
gLoadedData.insert(std::move(pluginData)); {
std::lock_guard lockLoadedData(gLoadedDataMutex);
gLoadedData.insert(std::move(pluginData));
}
} }
return PLUGIN_BACKEND_API_ERROR_NONE; return PLUGIN_BACKEND_API_ERROR_NONE;