X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=src%2Fabort.c;h=4ae157addacc1eeed2b0ac92710c2d04cc8a446e;hb=3c678195610789166e1133575789f25da8f1a291;hp=b2d2b67ab2122e3d840de23c425199352fe96401;hpb=46974bb948c0a7ca82b476a578b6199e438bab41;p=rodin%2Fchimara.git diff --git a/src/abort.c b/src/abort.c index b2d2b67..4ae157a 100644 --- a/src/abort.c +++ b/src/abort.c @@ -8,14 +8,15 @@ extern ChimaraGlkPrivate *glk_data; /** * glk_set_interrupt_handler: - * @func: A pointer to a function which takes no argument and returns no result. + * @func: A pointer to an interrupt handler function. * - * Specifies an interrupt handler function for cleaning up critical resources. - * If Glk receives an interrupt, and you have set an interrupt handler, your - * handler will be called, before the process is shut down. + * Sets @func to be the interrupt handler. @func should be a pointer to a + * function which takes no argument and returns no result. If Glk receives an + * interrupt, and you have set an interrupt handler, your handler will be + * called, before the process is shut down. * * Initially there is no interrupt handler. You can reset to not having any by - * calling glk_set_interrupt_handler(%NULL). + * calling #glk_set_interrupt_handler(%NULL). * * If you call glk_set_interrupt_handler() with a new handler function while an * older one is set, the new one replaces the old one. Glk does not try to queue @@ -38,6 +39,7 @@ abort_glk() { if(glk_data->interrupt_handler) (*(glk_data->interrupt_handler))(); + g_signal_emit_by_name(glk_data->self, "stopped"); g_thread_exit(NULL); } @@ -46,7 +48,7 @@ mutex has already been freed. (That means the thread already ended.) */ void signal_abort() { - if(glk_data->abort_lock) { + if(glk_data && glk_data->abort_lock) { g_mutex_lock(glk_data->abort_lock); glk_data->abort_signalled = TRUE; g_mutex_unlock(glk_data->abort_lock);