From 2853f7ae9b5d245614416e48a1972d166e295235 Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Mon, 5 Sep 2016 17:17:22 +0100 Subject: [PATCH] Terminate the application correctly --- src/anbox/ubuntu/window_creator.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/anbox/ubuntu/window_creator.cpp b/src/anbox/ubuntu/window_creator.cpp index ec442c0..7ba0c2c 100644 --- a/src/anbox/ubuntu/window_creator.cpp +++ b/src/anbox/ubuntu/window_creator.cpp @@ -21,6 +21,9 @@ #include +#include +#include + namespace anbox { namespace ubuntu { WindowCreator::WindowCreator(const std::shared_ptr &input_manager) : @@ -50,9 +53,10 @@ void WindowCreator::process_events() { while (SDL_WaitEventTimeout(&event, 100)) { switch (event.type) { case SDL_QUIT: - // FIXME: We exit here only as long as we don't have multi window - // support. - BOOST_THROW_EXCEPTION(std::runtime_error("User closed main application window")); + // This is the best way to reliable terminate the whole application for now. It will + // trigger a correct shutdown in the main part. + ::kill(getpid(), SIGTERM); + break; case SDL_WINDOWEVENT: process_window_event(event); break;