X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fchimara-glk.c;h=f4cd156fe3da9ae3a1d06127dde408aed12efd5d;hb=40c961bdf2523ebdcb6717f2537f97156fd19ab4;hp=8d1e65583c707a5d0d13c206f334d4b42223645f;hpb=4b0bbd6bb235b4cad89d321cdd7f570610a97712;p=rodin%2Fchimara.git diff --git a/libchimara/chimara-glk.c b/libchimara/chimara-glk.c index 8d1e655..f4cd156 100644 --- a/libchimara/chimara-glk.c +++ b/libchimara/chimara-glk.c @@ -108,6 +108,10 @@ chimara_glk_init(ChimaraGlk *self) priv->char_input_queue = g_async_queue_new(); priv->line_input_queue = g_async_queue_new(); /* Should be g_async_queue_new_full(g_free); but only in GTK >= 2.16 */ + priv->resource_lock = g_mutex_new(); + priv->resource_loaded = g_cond_new(); + priv->resource_info_available = g_cond_new(); + priv->image_cache = NULL; priv->interrupt_handler = NULL; priv->root_window = NULL; priv->fileref_list = NULL; @@ -215,6 +219,13 @@ chimara_glk_finalize(GObject *object) g_mutex_unlock(priv->arrange_lock); g_mutex_free(priv->arrange_lock); priv->arrange_lock = NULL; + g_mutex_lock(priv->resource_lock); + g_cond_free(priv->resource_loaded); + g_cond_free(priv->resource_info_available); + g_mutex_unlock(priv->resource_lock); + g_mutex_free(priv->resource_lock); + g_slist_foreach(priv->image_cache, (GFunc)clear_image_cache, NULL); + g_slist_free(priv->image_cache); /* Unref input queues (this should destroy them since any Glk thread has stopped by now */ g_async_queue_unref(priv->char_input_queue); g_async_queue_unref(priv->line_input_queue);