X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fabort.c;h=cec03a6a38cd84df1da4799762830a16500fafbe;hb=HEAD;hp=28e33fae444c5d85e64b29232d3b08d58b99572e;hpb=4b0bbd6bb235b4cad89d321cdd7f570610a97712;p=rodin%2Fchimara.git diff --git a/libchimara/abort.c b/libchimara/abort.c index 28e33fa..cec03a6 100644 --- a/libchimara/abort.c +++ b/libchimara/abort.c @@ -46,7 +46,7 @@ abort_glk(void) shutdown_glk_pre(); shutdown_glk_post(); /* If program is terminated by g_thread_exit() instead of returning from the - glk_main() function, then the line in glk_enter() where the "stopped" + glk_main() function, then the line in glk_exit() where the "stopped" signal is emitted will not be reached. So we have to emit it here. */ if(!glk_data->in_startup) g_signal_emit_by_name(glk_data->self, "stopped"); @@ -143,7 +143,13 @@ shutdown_glk_post(void) /* Empty the event queue */ g_mutex_lock(glk_data->event_lock); g_queue_foreach(glk_data->event_queue, (GFunc)g_free, NULL); - g_queue_clear(glk_data->event_queue); + + /* COMPAT: g_queue_clear could be used here, but only appeared in 2.14 */ + // g_queue_clear(glk_data->event_queue); + g_list_free(glk_data->event_queue->head); + glk_data->event_queue->head = glk_data->event_queue->tail = NULL; + glk_data->event_queue->length = 0; + g_mutex_unlock(glk_data->event_lock); /* Reset the abort signaling mechanism */ @@ -170,6 +176,4 @@ shutdown_glk_post(void) glk_data->unregister_obj = NULL; glk_data->register_arr = NULL; glk_data->unregister_arr = NULL; - - /* Leave the style_initialized flag as it is, since the CSS file is a widget property */ }