From a976056afba629e323d755f731b4c4ad0ab34b55 Mon Sep 17 00:00:00 2001 From: DrChat Date: Wed, 28 Feb 2018 15:05:10 -0600 Subject: [PATCH] [UI] Shut down the profiler before the graphics context --- src/xenia/app/xenia_main.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xenia/app/xenia_main.cc b/src/xenia/app/xenia_main.cc index c715e733e..7b20892a7 100644 --- a/src/xenia/app/xenia_main.cc +++ b/src/xenia/app/xenia_main.cc @@ -174,13 +174,17 @@ int xenia_main(const std::vector& args) { evt->Set(); }); + emulator_window->window()->on_closing.AddListener([&](ui::UIEvent* e) { + // This needs to shut down before the graphics context. + Profiler::Shutdown(); + }); + bool exiting = false; emulator_window->loop()->on_quit.AddListener([&](ui::UIEvent* e) { exiting = true; evt->Set(); // TODO(DrChat): Remove this code and do a proper exit. - Profiler::Shutdown(); XELOGI("Cheap-skate exit!"); exit(0); });