diff --git a/main/gui/source/init/run/native.cpp b/main/gui/source/init/run/native.cpp index eb261a3fd..f11cffc53 100644 --- a/main/gui/source/init/run/native.cpp +++ b/main/gui/source/init/run/native.cpp @@ -27,14 +27,13 @@ handleFileOpenRequest(); } - // Clean up everything after the main window is closed - ON_SCOPE_EXIT { - deinitializeImHex(); - }; - // Main window - Window window; - window.loop(); + { + Window window; + window.loop(); + } + + deinitializeImHex(); } while (shouldRestart);