added g_hook_list_marshal_check() to eventually destroy hooks after they

Mon Nov 30 07:12:10 1998  Tim Janik  <timj@gtk.org>

        * glib.h:
        * ghook.c: added g_hook_list_marshal_check() to eventually destroy
        hooks after they got marshalled.
This commit is contained in:
Tim Janik 1998-11-30 07:08:54 +00:00 committed by Tim Janik
parent e54410edc2
commit 958f33656a
12 changed files with 132 additions and 0 deletions

View File

@ -1,3 +1,9 @@
Mon Nov 30 07:12:10 1998 Tim Janik <timj@gtk.org>
* glib.h:
* ghook.c: added g_hook_list_marshal_check() to eventually destroy
hooks after they got marshalled.
Sun Nov 29 17:31:43 EST 1998 Jeff Garzik <jgarzik@pobox.com>
* configure.in, Makefile.am, gmodule/Makefile.am:

View File

@ -1,3 +1,9 @@
Mon Nov 30 07:12:10 1998 Tim Janik <timj@gtk.org>
* glib.h:
* ghook.c: added g_hook_list_marshal_check() to eventually destroy
hooks after they got marshalled.
Sun Nov 29 17:31:43 EST 1998 Jeff Garzik <jgarzik@pobox.com>
* configure.in, Makefile.am, gmodule/Makefile.am:

View File

@ -1,3 +1,9 @@
Mon Nov 30 07:12:10 1998 Tim Janik <timj@gtk.org>
* glib.h:
* ghook.c: added g_hook_list_marshal_check() to eventually destroy
hooks after they got marshalled.
Sun Nov 29 17:31:43 EST 1998 Jeff Garzik <jgarzik@pobox.com>
* configure.in, Makefile.am, gmodule/Makefile.am:

View File

@ -1,3 +1,9 @@
Mon Nov 30 07:12:10 1998 Tim Janik <timj@gtk.org>
* glib.h:
* ghook.c: added g_hook_list_marshal_check() to eventually destroy
hooks after they got marshalled.
Sun Nov 29 17:31:43 EST 1998 Jeff Garzik <jgarzik@pobox.com>
* configure.in, Makefile.am, gmodule/Makefile.am:

View File

@ -1,3 +1,9 @@
Mon Nov 30 07:12:10 1998 Tim Janik <timj@gtk.org>
* glib.h:
* ghook.c: added g_hook_list_marshal_check() to eventually destroy
hooks after they got marshalled.
Sun Nov 29 17:31:43 EST 1998 Jeff Garzik <jgarzik@pobox.com>
* configure.in, Makefile.am, gmodule/Makefile.am:

View File

@ -1,3 +1,9 @@
Mon Nov 30 07:12:10 1998 Tim Janik <timj@gtk.org>
* glib.h:
* ghook.c: added g_hook_list_marshal_check() to eventually destroy
hooks after they got marshalled.
Sun Nov 29 17:31:43 EST 1998 Jeff Garzik <jgarzik@pobox.com>
* configure.in, Makefile.am, gmodule/Makefile.am:

View File

@ -1,3 +1,9 @@
Mon Nov 30 07:12:10 1998 Tim Janik <timj@gtk.org>
* glib.h:
* ghook.c: added g_hook_list_marshal_check() to eventually destroy
hooks after they got marshalled.
Sun Nov 29 17:31:43 EST 1998 Jeff Garzik <jgarzik@pobox.com>
* configure.in, Makefile.am, gmodule/Makefile.am:

View File

@ -1,3 +1,9 @@
Mon Nov 30 07:12:10 1998 Tim Janik <timj@gtk.org>
* glib.h:
* ghook.c: added g_hook_list_marshal_check() to eventually destroy
hooks after they got marshalled.
Sun Nov 29 17:31:43 EST 1998 Jeff Garzik <jgarzik@pobox.com>
* configure.in, Makefile.am, gmodule/Makefile.am:

36
ghook.c
View File

@ -323,6 +323,42 @@ g_hook_list_invoke_check (GHookList *hook_list,
}
}
void
g_hook_list_marshal_check (GHookList *hook_list,
gboolean may_recurse,
GHookCheckMarshaller marshaller,
gpointer data)
{
GHook *hook;
g_return_if_fail (hook_list != NULL);
g_return_if_fail (hook_list->is_setup);
g_return_if_fail (marshaller != NULL);
hook = g_hook_first_valid (hook_list, may_recurse);
while (hook)
{
GHook *tmp;
gboolean was_in_call;
gboolean need_destroy;
g_hook_ref (hook_list, hook);
was_in_call = G_HOOK_IN_CALL (hook);
hook->flags |= G_HOOK_FLAG_IN_CALL;
need_destroy = !marshaller (hook, data);
if (!was_in_call)
hook->flags &= ~G_HOOK_FLAG_IN_CALL;
if (need_destroy)
g_hook_destroy_link (hook_list, hook);
tmp = g_hook_next_valid (hook, may_recurse);
g_hook_unref (hook_list, hook);
hook = tmp;
}
}
void
g_hook_list_marshal (GHookList *hook_list,
gboolean may_recurse,

6
glib.h
View File

@ -765,6 +765,8 @@ typedef gboolean (*GHookFindFunc) (GHook *hook,
gpointer data);
typedef void (*GHookMarshaller) (GHook *hook,
gpointer data);
typedef gboolean (*GHookCheckMarshaller) (GHook *hook,
gpointer data);
typedef void (*GHookFunc) (gpointer data);
typedef gboolean (*GHookCheckFunc) (gpointer data);
typedef void (*GHookFreeFunc) (GHookList *hook_list,
@ -1215,6 +1217,10 @@ void g_hook_list_marshal (GHookList *hook_list,
gboolean may_recurse,
GHookMarshaller marshaller,
gpointer data);
void g_hook_list_marshal_check (GHookList *hook_list,
gboolean may_recurse,
GHookCheckMarshaller marshaller,
gpointer data);
/* Fatal error handlers.

View File

@ -323,6 +323,42 @@ g_hook_list_invoke_check (GHookList *hook_list,
}
}
void
g_hook_list_marshal_check (GHookList *hook_list,
gboolean may_recurse,
GHookCheckMarshaller marshaller,
gpointer data)
{
GHook *hook;
g_return_if_fail (hook_list != NULL);
g_return_if_fail (hook_list->is_setup);
g_return_if_fail (marshaller != NULL);
hook = g_hook_first_valid (hook_list, may_recurse);
while (hook)
{
GHook *tmp;
gboolean was_in_call;
gboolean need_destroy;
g_hook_ref (hook_list, hook);
was_in_call = G_HOOK_IN_CALL (hook);
hook->flags |= G_HOOK_FLAG_IN_CALL;
need_destroy = !marshaller (hook, data);
if (!was_in_call)
hook->flags &= ~G_HOOK_FLAG_IN_CALL;
if (need_destroy)
g_hook_destroy_link (hook_list, hook);
tmp = g_hook_next_valid (hook, may_recurse);
g_hook_unref (hook_list, hook);
hook = tmp;
}
}
void
g_hook_list_marshal (GHookList *hook_list,
gboolean may_recurse,

View File

@ -765,6 +765,8 @@ typedef gboolean (*GHookFindFunc) (GHook *hook,
gpointer data);
typedef void (*GHookMarshaller) (GHook *hook,
gpointer data);
typedef gboolean (*GHookCheckMarshaller) (GHook *hook,
gpointer data);
typedef void (*GHookFunc) (gpointer data);
typedef gboolean (*GHookCheckFunc) (gpointer data);
typedef void (*GHookFreeFunc) (GHookList *hook_list,
@ -1215,6 +1217,10 @@ void g_hook_list_marshal (GHookList *hook_list,
gboolean may_recurse,
GHookMarshaller marshaller,
gpointer data);
void g_hook_list_marshal_check (GHookList *hook_list,
gboolean may_recurse,
GHookCheckMarshaller marshaller,
gpointer data);
/* Fatal error handlers.