diff --git a/ChangeLog b/ChangeLog index e9a858419..54d0d191e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Mar 8 07:42:08 1999 Tim Janik + + * ghook.c (g_hook_unref): when !hook_list->is_setup, wrap the + flag around the call to g_hook_free() to avoid spurious + warnings (happens during destruction phase). + 1999-03-03 Sebastian Wilhelmi * glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index e9a858419..54d0d191e 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +Mon Mar 8 07:42:08 1999 Tim Janik + + * ghook.c (g_hook_unref): when !hook_list->is_setup, wrap the + flag around the call to g_hook_free() to avoid spurious + warnings (happens during destruction phase). + 1999-03-03 Sebastian Wilhelmi * glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e9a858419..54d0d191e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Mon Mar 8 07:42:08 1999 Tim Janik + + * ghook.c (g_hook_unref): when !hook_list->is_setup, wrap the + flag around the call to g_hook_free() to avoid spurious + warnings (happens during destruction phase). + 1999-03-03 Sebastian Wilhelmi * glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index e9a858419..54d0d191e 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,9 @@ +Mon Mar 8 07:42:08 1999 Tim Janik + + * ghook.c (g_hook_unref): when !hook_list->is_setup, wrap the + flag around the call to g_hook_free() to avoid spurious + warnings (happens during destruction phase). + 1999-03-03 Sebastian Wilhelmi * glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index e9a858419..54d0d191e 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Mon Mar 8 07:42:08 1999 Tim Janik + + * ghook.c (g_hook_unref): when !hook_list->is_setup, wrap the + flag around the call to g_hook_free() to avoid spurious + warnings (happens during destruction phase). + 1999-03-03 Sebastian Wilhelmi * glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index e9a858419..54d0d191e 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Mon Mar 8 07:42:08 1999 Tim Janik + + * ghook.c (g_hook_unref): when !hook_list->is_setup, wrap the + flag around the call to g_hook_free() to avoid spurious + warnings (happens during destruction phase). + 1999-03-03 Sebastian Wilhelmi * glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index e9a858419..54d0d191e 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Mon Mar 8 07:42:08 1999 Tim Janik + + * ghook.c (g_hook_unref): when !hook_list->is_setup, wrap the + flag around the call to g_hook_free() to avoid spurious + warnings (happens during destruction phase). + 1999-03-03 Sebastian Wilhelmi * glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e9a858419..54d0d191e 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Mon Mar 8 07:42:08 1999 Tim Janik + + * ghook.c (g_hook_unref): when !hook_list->is_setup, wrap the + flag around the call to g_hook_free() to avoid spurious + warnings (happens during destruction phase). + 1999-03-03 Sebastian Wilhelmi * glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX diff --git a/ghook.c b/ghook.c index a3e3a78f7..09e888366 100644 --- a/ghook.c +++ b/ghook.c @@ -177,6 +177,7 @@ g_hook_unref (GHookList *hook_list, GHook *hook) { g_return_if_fail (hook_list != NULL); + g_return_if_fail (hook_list->hook_memchunk != NULL); g_return_if_fail (hook != NULL); g_return_if_fail (hook->ref_count > 0); @@ -196,15 +197,21 @@ g_hook_unref (GHookList *hook_list, hook->next = NULL; } hook->prev = NULL; - - g_hook_free (hook_list, hook); - - if (!hook_list->hooks && - !hook_list->is_setup) + + if (!hook_list->is_setup) { - g_mem_chunk_destroy (hook_list->hook_memchunk); - hook_list->hook_memchunk = NULL; + hook_list->is_setup = TRUE; + g_hook_free (hook_list, hook); + hook_list->is_setup = FALSE; + + if (!hook_list->hooks) + { + g_mem_chunk_destroy (hook_list->hook_memchunk); + hook_list->hook_memchunk = NULL; + } } + else + g_hook_free (hook_list, hook); } } diff --git a/glib/ghook.c b/glib/ghook.c index a3e3a78f7..09e888366 100644 --- a/glib/ghook.c +++ b/glib/ghook.c @@ -177,6 +177,7 @@ g_hook_unref (GHookList *hook_list, GHook *hook) { g_return_if_fail (hook_list != NULL); + g_return_if_fail (hook_list->hook_memchunk != NULL); g_return_if_fail (hook != NULL); g_return_if_fail (hook->ref_count > 0); @@ -196,15 +197,21 @@ g_hook_unref (GHookList *hook_list, hook->next = NULL; } hook->prev = NULL; - - g_hook_free (hook_list, hook); - - if (!hook_list->hooks && - !hook_list->is_setup) + + if (!hook_list->is_setup) { - g_mem_chunk_destroy (hook_list->hook_memchunk); - hook_list->hook_memchunk = NULL; + hook_list->is_setup = TRUE; + g_hook_free (hook_list, hook); + hook_list->is_setup = FALSE; + + if (!hook_list->hooks) + { + g_mem_chunk_destroy (hook_list->hook_memchunk); + hook_list->hook_memchunk = NULL; + } } + else + g_hook_free (hook_list, hook); } }