#include "chimara-glk-private.h"
#include "gi_blorb.h"
-G_GNUC_INTERNAL ChimaraGlkPrivate *glk_data = NULL;
+G_GNUC_INTERNAL GPrivate *glk_data_key = NULL;
/**
* glk_exit:
void
glk_exit(void)
{
- g_signal_emit_by_name(glk_data->self, "stopped");
+ 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);
glk_stream_close(glk_data->resource_file, NULL);
}
- glk_data = NULL;
g_thread_exit(NULL);
}