mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-08 20:58:41 +00:00
Lock linker mutex in RelocateAnyImports (#3693)
Module relocation is not thread safe, games calling LoadAndStartModule on multiple threads can invalidate pointers while iterating through m_modules. This fixes crashes in some apps on Windows.
This commit is contained in:
@@ -111,6 +111,8 @@ public:
|
||||
}
|
||||
|
||||
void RelocateAnyImports(Module* m) {
|
||||
std::scoped_lock lk{mutex};
|
||||
|
||||
Relocate(m);
|
||||
const auto exports = m->GetExportModules();
|
||||
for (auto& export_mod : exports) {
|
||||
|
||||
Reference in New Issue
Block a user