when !hook_list->is_setup, wrap the flag around the call to g_hook_free()

Mon Mar  8 07:42:08 1999  Tim Janik  <timj@gtk.org>

        * 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).
This commit is contained in:
Tim Janik 1999-03-08 21:11:13 +00:00 committed by Tim Janik
parent 45ce5e5c30
commit 6e6166ddd3
10 changed files with 76 additions and 14 deletions

View File

@ -1,3 +1,9 @@
Mon Mar 8 07:42:08 1999 Tim Janik <timj@gtk.org>
* 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 <wilhelmi@ira.uka.de> 1999-03-03 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX * glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX

View File

@ -1,3 +1,9 @@
Mon Mar 8 07:42:08 1999 Tim Janik <timj@gtk.org>
* 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 <wilhelmi@ira.uka.de> 1999-03-03 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX * glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX

View File

@ -1,3 +1,9 @@
Mon Mar 8 07:42:08 1999 Tim Janik <timj@gtk.org>
* 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 <wilhelmi@ira.uka.de> 1999-03-03 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX * glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX

View File

@ -1,3 +1,9 @@
Mon Mar 8 07:42:08 1999 Tim Janik <timj@gtk.org>
* 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 <wilhelmi@ira.uka.de> 1999-03-03 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX * glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX

View File

@ -1,3 +1,9 @@
Mon Mar 8 07:42:08 1999 Tim Janik <timj@gtk.org>
* 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 <wilhelmi@ira.uka.de> 1999-03-03 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX * glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX

View File

@ -1,3 +1,9 @@
Mon Mar 8 07:42:08 1999 Tim Janik <timj@gtk.org>
* 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 <wilhelmi@ira.uka.de> 1999-03-03 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX * glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX

View File

@ -1,3 +1,9 @@
Mon Mar 8 07:42:08 1999 Tim Janik <timj@gtk.org>
* 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 <wilhelmi@ira.uka.de> 1999-03-03 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX * glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX

View File

@ -1,3 +1,9 @@
Mon Mar 8 07:42:08 1999 Tim Janik <timj@gtk.org>
* 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 <wilhelmi@ira.uka.de> 1999-03-03 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX * glibconfig.h.win32, config.h.win32: Moved G_THREADS_IMPL_POSIX

21
ghook.c
View File

@ -177,6 +177,7 @@ g_hook_unref (GHookList *hook_list,
GHook *hook) GHook *hook)
{ {
g_return_if_fail (hook_list != NULL); 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 != NULL);
g_return_if_fail (hook->ref_count > 0); g_return_if_fail (hook->ref_count > 0);
@ -196,15 +197,21 @@ g_hook_unref (GHookList *hook_list,
hook->next = NULL; hook->next = NULL;
} }
hook->prev = NULL; hook->prev = NULL;
g_hook_free (hook_list, hook); if (!hook_list->is_setup)
if (!hook_list->hooks &&
!hook_list->is_setup)
{ {
g_mem_chunk_destroy (hook_list->hook_memchunk); hook_list->is_setup = TRUE;
hook_list->hook_memchunk = NULL; 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);
} }
} }

View File

@ -177,6 +177,7 @@ g_hook_unref (GHookList *hook_list,
GHook *hook) GHook *hook)
{ {
g_return_if_fail (hook_list != NULL); 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 != NULL);
g_return_if_fail (hook->ref_count > 0); g_return_if_fail (hook->ref_count > 0);
@ -196,15 +197,21 @@ g_hook_unref (GHookList *hook_list,
hook->next = NULL; hook->next = NULL;
} }
hook->prev = NULL; hook->prev = NULL;
g_hook_free (hook_list, hook); if (!hook_list->is_setup)
if (!hook_list->hooks &&
!hook_list->is_setup)
{ {
g_mem_chunk_destroy (hook_list->hook_memchunk); hook_list->is_setup = TRUE;
hook_list->hook_memchunk = NULL; 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);
} }
} }