GPU: Fix possible race in screenshot

This commit is contained in:
Stenzek 2024-08-12 14:46:20 +10:00
parent 9a58327cf2
commit c30c4a5d0a
No known key found for this signature in database

View file

@ -2603,9 +2603,9 @@ bool CompressAndWriteTextureToFile(u32 width, u32 height, std::string filename,
std::move(texture_data), texture_data_stride, texture_format, std::move(osd_key), use_thread);
}
std::unique_lock lock(s_screenshot_threads_mutex);
std::thread thread(proc, width, height, std::move(filename), std::move(fp), quality, clear_alpha, flip_y,
std::move(texture_data), texture_data_stride, texture_format, std::move(osd_key), use_thread);
std::unique_lock lock(s_screenshot_threads_mutex);
s_screenshot_threads.push_back(std::move(thread));
return true;
}