fix(controller): Raise signal on quit from eventqueue

This commit is contained in:
Michael Carlberg 2016-12-23 05:51:33 +01:00
parent e974ac1750
commit e551dbfea9

View File

@ -318,11 +318,11 @@ void controller::process_eventqueue() {
event evt{}; event evt{};
m_queue.wait_dequeue(evt); m_queue.wait_dequeue(evt);
if (g_terminate || evt.type == static_cast<uint8_t>(event_type::QUIT)) { if (g_terminate) {
break; break;
} } else if (evt.type == static_cast<uint8_t>(event_type::QUIT)) {
m_sig.emit(sig_ev::process_quit{make_quit_evt(evt.flag)});
if (evt.type == static_cast<uint8_t>(event_type::INPUT)) { } else if (evt.type == static_cast<uint8_t>(event_type::INPUT)) {
process_inputdata(); process_inputdata();
} else { } else {
event next{}; event next{};
@ -502,8 +502,7 @@ bool controller::on(const sig_ev::process_input& evt) {
* Process eventqueue quit event * Process eventqueue quit event
*/ */
bool controller::on(const sig_ev::process_quit& evt) { bool controller::on(const sig_ev::process_quit& evt) {
bool reload{evt.data()->flag}; raise(evt.data()->flag ? SIGUSR1 : SIGALRM);
raise(reload ? SIGUSR1 : SIGALRM);
return true; return true;
} }