From d69c1a72b4ba5a44d57d30e4f453eb17798efc0d Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Tue, 17 Oct 2000 21:38:42 +0000 Subject: [PATCH] gimp_uninstall_temp_proc(): free the original hash key _after_ removing 2000-10-17 Michael Natterer * libgimp/gimp.c: gimp_uninstall_temp_proc(): free the original hash key _after_ removing the procedure from the hash table. I didn't observe any crash from this bug, but as the function is called *only* from - plug-ins/perl/Gimp/Lib.c and - plug-ins/script-fu/script-fu-scripts.c it may have been the reason for various reported perl<->script-fu problems. Bug reporters, please check your bugs. --- ChangeLog | 16 +++++++++++++++- libgimp/gimp.c | 4 ++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a48f95666c..bc4e21599b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,18 @@ -2000-10-17 Sven Neumann +2000-10-17 Michael Natterer + + * libgimp/gimp.c: gimp_uninstall_temp_proc(): free the original + hash key _after_ removing the procedure from the hash table. + + I didn't observe any crash from this bug, but as the function + is called *only* from + + - plug-ins/perl/Gimp/Lib.c and + - plug-ins/script-fu/script-fu-scripts.c + + it may have been the reason for various reported perl<->script-fu + problems. Bug reporters, please check your bugs. + +x2000-10-17 Sven Neumann * app/paint_funcs.c * app/pixel_processor.c diff --git a/libgimp/gimp.c b/libgimp/gimp.c index 50696adecf..47d79020ff 100644 --- a/libgimp/gimp.c +++ b/libgimp/gimp.c @@ -276,7 +276,7 @@ gimp_main (int argc, return 0; } - temp_proc_ht = g_hash_table_new (&g_str_hash, &g_str_equal); + temp_proc_ht = g_hash_table_new (g_str_hash, g_str_equal); g_io_add_watch (_readchannel, G_IO_ERR | G_IO_HUP, @@ -406,8 +406,8 @@ gimp_uninstall_temp_proc (gchar *name) found = g_hash_table_lookup_extended (temp_proc_ht, name, &hash_name, NULL); if (found) { - g_free (hash_name); g_hash_table_remove (temp_proc_ht, (gpointer) name); + g_free (hash_name); } }