X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;ds=sidebyside;f=libchimara%2Fabort.c;h=8399f054901376b1d1790bc2639d5c4a27c330cc;hb=aadf847cc2cbf941c83cf7359b411517d0d40e43;hp=517dec5649761308b2592be09f6c78feced3c94c;hpb=62a53e1c8b216c67388a44499394fbd62f51cb98;p=projects%2Fchimara%2Fchimara.git diff --git a/libchimara/abort.c b/libchimara/abort.c index 517dec5..8399f05 100644 --- a/libchimara/abort.c +++ b/libchimara/abort.c @@ -4,6 +4,7 @@ #include #include "chimara-glk-private.h" +#include "window.h" extern GPrivate *glk_data_key; @@ -66,9 +67,6 @@ shutdown_glk(void) { ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key); - if(!glk_data->in_startup) - g_signal_emit_by_name(glk_data->self, "stopped"); - /* Stop any timers */ glk_request_timer_events(0); @@ -110,5 +108,11 @@ shutdown_glk(void) g_cond_wait(glk_data->rearranged, glk_data->arrange_lock); g_mutex_unlock(glk_data->arrange_lock); - chimara_glk_reset(glk_data->self); + /* Default handler for 'stopped' unloads the plugin, so be absolutely sure + we're not calling any dispatch callbacks after this point */ + if(!glk_data->in_startup) + g_signal_emit_by_name(glk_data->self, "stopped"); + + _chimara_glk_free_nonwindow_private_data(glk_data); + glk_data->needs_reset = TRUE; }