From 647e92b74f6f605c62d46ce664d2e176cd7a48d8 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 14 Nov 2020 23:39:44 +0100 Subject: [PATCH] UserspaceEmulator: Skip destroying the Emulator object on shutdown There are some destruction order races that can cause hangs while shutting down UE. Since there's no particular value right now in destroying the Emulator object properly, just avoid destruction and add a FIXME about looking into it later. --- DevTools/UserspaceEmulator/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DevTools/UserspaceEmulator/main.cpp b/DevTools/UserspaceEmulator/main.cpp index e88b5d77f9..85b53753a0 100644 --- a/DevTools/UserspaceEmulator/main.cpp +++ b/DevTools/UserspaceEmulator/main.cpp @@ -68,7 +68,8 @@ int main(int argc, char** argv, char** env) environment.append(env[i]); } - UserspaceEmulator::Emulator emulator(arguments, environment, move(elf)); + // FIXME: It might be nice to tear down the emulator properly. + auto& emulator = *new UserspaceEmulator::Emulator(arguments, environment, move(elf)); if (!emulator.load_elf()) return 1;