Making shutdown clean.

This commit is contained in:
Ben Vanik
2015-07-25 12:56:37 -07:00
parent 89adaf8e85
commit abf50b477e
4 changed files with 12 additions and 12 deletions

View File

@@ -32,7 +32,9 @@ EmulatorWindow::EmulatorWindow(Emulator* emulator)
loop_(ui::Loop::Create()),
window_(ui::Window::Create(loop_.get(), kBaseTitle)) {}
EmulatorWindow::~EmulatorWindow() = default;
EmulatorWindow::~EmulatorWindow() {
loop_->PostSynchronous([this]() { window_.reset(); });
}
std::unique_ptr<EmulatorWindow> EmulatorWindow::Create(Emulator* emulator) {
std::unique_ptr<EmulatorWindow> emulator_window(new EmulatorWindow(emulator));