From fd28ea00badd7c830037d629f2e6f0965247b7e3 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 21 Nov 2002 13:00:14 +0000 Subject: Protect against foreach over null pointer. --- gtk/PlatGTK.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 2554f3dd4..8c19e5f85 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -1159,8 +1159,10 @@ static void list_image_free(gpointer, gpointer value, gpointer) { } ListBox::~ListBox() { - g_hash_table_foreach((GHashTable *) pixhash, list_image_free, NULL); - g_hash_table_destroy((GHashTable *) pixhash); + if (pixhash) { + g_hash_table_foreach((GHashTable *) pixhash, list_image_free, NULL); + g_hash_table_destroy((GHashTable *) pixhash); + } } static void SelectionAC(GtkWidget *, gint row, gint, -- cgit v1.2.3