From 8ec8d9778f230e8166e205b00bf10f789f702187 Mon Sep 17 00:00:00 2001 From: DrChat Date: Sun, 17 Dec 2017 12:37:58 -0600 Subject: [PATCH] [UI] Shuffle some exit handling code around --- src/xenia/app/emulator_window.cc | 4 ---- src/xenia/app/xenia_main.cc | 3 +++ src/xenia/ui/window_win.cc | 4 ---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/xenia/app/emulator_window.cc b/src/xenia/app/emulator_window.cc index bcb5381b4..cea5e2009 100644 --- a/src/xenia/app/emulator_window.cc +++ b/src/xenia/app/emulator_window.cc @@ -75,10 +75,6 @@ bool EmulatorWindow::Initialize() { window_->on_closed.AddListener([this](UIEvent* e) { loop_->Quit(); - - // TODO(benvanik): proper exit. - XELOGI("User-initiated death!"); - exit(1); }); loop_->on_quit.AddListener([this](UIEvent* e) { window_.reset(); }); diff --git a/src/xenia/app/xenia_main.cc b/src/xenia/app/xenia_main.cc index a8e136db3..2221413c1 100644 --- a/src/xenia/app/xenia_main.cc +++ b/src/xenia/app/xenia_main.cc @@ -178,6 +178,9 @@ int xenia_main(const std::vector& args) { emulator_window->loop()->on_quit.AddListener([&](ui::UIEvent* e) { exiting = true; evt->Set(); + + XELOGI("Cheap-skate exit!"); + exit(0); }); // Enable the main menu now that the emulator is properly loaded diff --git a/src/xenia/ui/window_win.cc b/src/xenia/ui/window_win.cc index fb6f21a62..50216fc57 100644 --- a/src/xenia/ui/window_win.cc +++ b/src/xenia/ui/window_win.cc @@ -169,7 +169,6 @@ void Win32Window::OnDestroy() { super::OnDestroy(); } void Win32Window::OnClose() { if (!closing_ && hwnd_) { closing_ = true; - CloseWindow(hwnd_); } super::OnClose(); } @@ -428,7 +427,6 @@ void Win32Window::Close() { return; } closing_ = true; - Close(); OnClose(); DestroyWindow(hwnd_); } @@ -509,8 +507,6 @@ LRESULT Win32Window::WndProc(HWND hWnd, UINT message, WPARAM wParam, OnDestroy(); break; case WM_CLOSE: - closing_ = true; - Close(); OnClose(); break;