From 5d29fc8d5b231c0390f8a4cbebec97c7a51b8f69 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Thu, 3 Dec 2009 22:04:26 +0000 Subject: [PATCH] Bug fixes git-svn-id: http://lassie.dyndns-server.com/svn/gargoyle-gtk@198 ddfedd41-794f-dd11-ae45-00112f111e67 --- libchimara/chimara-glk.c | 12 ++++++++++-- tests/glulxercise.c | 7 +++++++ tests/glulxercise.ui | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/libchimara/chimara-glk.c b/libchimara/chimara-glk.c index 0fabb39..93f95c7 100644 --- a/libchimara/chimara-glk.c +++ b/libchimara/chimara-glk.c @@ -235,8 +235,10 @@ void _chimara_glk_free_window_private_data(ChimaraGlkPrivate *priv) { /* Destroy the window tree */ - trash_windows_recursive(priv, priv->root_window->data); - g_node_destroy(priv->root_window); + if(priv->root_window) { + trash_windows_recursive(priv, priv->root_window->data); + g_node_destroy(priv->root_window); + } /* Free the window arrangement signaling */ g_mutex_lock(priv->arrange_lock); @@ -244,6 +246,12 @@ _chimara_glk_free_window_private_data(ChimaraGlkPrivate *priv) g_mutex_unlock(priv->arrange_lock); g_mutex_free(priv->arrange_lock); priv->arrange_lock = NULL; + + /* Remove the dispatch callbacks */ + priv->register_obj = NULL; + priv->unregister_obj = NULL; + priv->register_arr = NULL; + priv->unregister_arr = NULL; } static void diff --git a/tests/glulxercise.c b/tests/glulxercise.c index a389d89..b5d3513 100644 --- a/tests/glulxercise.c +++ b/tests/glulxercise.c @@ -9,6 +9,13 @@ typedef struct { GtkWidget *window, *test_picker, *go, *stop, *interp; } Widgets; +gboolean +on_window_delete_event() +{ + gtk_main_quit(); + return TRUE; +} + void on_go_clicked(GtkButton *go, Widgets *w) { diff --git a/tests/glulxercise.ui b/tests/glulxercise.ui index 934e677..5ca17ae 100644 --- a/tests/glulxercise.ui +++ b/tests/glulxercise.ui @@ -4,7 +4,7 @@ 6 - + True -- 2.30.2