mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-25 14:41:02 +00:00
Fix exception when NtTerminateThread is called on the active thread.
This commit is contained in:
@@ -52,6 +52,7 @@ namespace
|
||||
void perform_context_switch_work(windows_emulator& win_emu)
|
||||
{
|
||||
auto& threads = win_emu.process.threads;
|
||||
auto*& active = win_emu.process.active_thread;
|
||||
|
||||
for (auto it = threads.begin(); it != threads.end();)
|
||||
{
|
||||
@@ -61,6 +62,11 @@ namespace
|
||||
continue;
|
||||
}
|
||||
|
||||
if (active == &it->second)
|
||||
{
|
||||
active = nullptr;
|
||||
}
|
||||
|
||||
const auto [new_it, deleted] = threads.erase(it);
|
||||
if (!deleted)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user