mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2026-09-08 20:08:45 -05:00
Capture values by reference in lambdas
This commit is contained in:
@@ -47,7 +47,7 @@ extern "C" PluginBackendApiErrorType WUPSLoadAndLinkByDataHandle(const wups_back
|
||||
extern "C" PluginBackendApiErrorType WUPSDeletePluginData(const wups_backend_plugin_data_handle *plugin_data_handle_list, uint32_t plugin_data_handle_list_size) {
|
||||
if (plugin_data_handle_list != nullptr && plugin_data_handle_list_size != 0) {
|
||||
for (auto &handle : std::span(plugin_data_handle_list, plugin_data_handle_list_size)) {
|
||||
if (!remove_locked_first_if(gLoadedDataMutex, gLoadedData, [handle](auto &cur) { return cur->getHandle() == handle; })) {
|
||||
if (!remove_locked_first_if(gLoadedDataMutex, gLoadedData, [&handle](auto &cur) { return cur->getHandle() == handle; })) {
|
||||
DEBUG_FUNCTION_LINE_ERR("Failed to delete plugin data by handle %08X", handle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@ namespace StorageUtils {
|
||||
auto res = StorageUtils::Helper::WriteStorageToSD(root, false);
|
||||
// TODO: handle write error?
|
||||
|
||||
if (!remove_locked_first_if(gStorageMutex, gStorage, [root](auto &cur) { return cur.getHandle() == (uint32_t) root; })) {
|
||||
if (!remove_locked_first_if(gStorageMutex, gStorage, [&root](auto &cur) { return cur.getHandle() == (uint32_t) root; })) {
|
||||
DEBUG_FUNCTION_LINE_WARN("Failed to close storage: Not opened (\"%08X\")", root);
|
||||
return WUPS_STORAGE_ERROR_NOT_FOUND;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user