From e551dbfea9b4d4fdea990de341917dec55ade809 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Fri, 23 Dec 2016 05:51:33 +0100 Subject: [PATCH] fix(controller): Raise signal on quit from eventqueue --- src/components/controller.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/controller.cpp b/src/components/controller.cpp index 6eb744d8..9ef6d280 100644 --- a/src/components/controller.cpp +++ b/src/components/controller.cpp @@ -318,11 +318,11 @@ void controller::process_eventqueue() { event evt{}; m_queue.wait_dequeue(evt); - if (g_terminate || evt.type == static_cast(event_type::QUIT)) { + if (g_terminate) { break; - } - - if (evt.type == static_cast(event_type::INPUT)) { + } else if (evt.type == static_cast(event_type::QUIT)) { + m_sig.emit(sig_ev::process_quit{make_quit_evt(evt.flag)}); + } else if (evt.type == static_cast(event_type::INPUT)) { process_inputdata(); } else { event next{}; @@ -502,8 +502,7 @@ bool controller::on(const sig_ev::process_input& evt) { * Process eventqueue quit event */ bool controller::on(const sig_ev::process_quit& evt) { - bool reload{evt.data()->flag}; - raise(reload ? SIGUSR1 : SIGALRM); + raise(evt.data()->flag ? SIGUSR1 : SIGALRM); return true; }