mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-12-10 18:43:42 +01:00
there was a reference count race for hooks during invocation loops. since
Mon Dec 21 21:48:29 1998 Tim Janik <timj@gtk.org> * glib.h: * gmain.c: there was a reference count race for hooks during invocation loops. since all (known) hook loop implementations, do currently start out with g_hook_first_valid() and iterate with g_hook_next_valid(), g_hook_first_valid() will now return a referenced hook, and g_hook_next_valid() will "eat" that, and eventually transfer it to the next hook. <sigh> unfortunately this requires g_hook_next_valid() to take the hook_list as additional argument. * gmain.c (g_main_iterate): adjusted callers of g_hook_next_valid().
This commit is contained in:
7
glib.h
7
glib.h
@@ -1183,9 +1183,14 @@ GHook* g_hook_find_func_data (GHookList *hook_list,
|
||||
gboolean need_valids,
|
||||
gpointer func,
|
||||
gpointer data);
|
||||
/* return the first valid hook, and increment its reference count */
|
||||
GHook* g_hook_first_valid (GHookList *hook_list,
|
||||
gboolean may_be_in_call);
|
||||
GHook* g_hook_next_valid (GHook *hook,
|
||||
/* return the next valid hook with incremented reference count, and
|
||||
* decrement the reference count of the original hook
|
||||
*/
|
||||
GHook* g_hook_next_valid (GHookList *hook_list,
|
||||
GHook *hook,
|
||||
gboolean may_be_in_call);
|
||||
|
||||
/* GHookCompareFunc implementation to insert hooks sorted by their id */
|
||||
|
||||
Reference in New Issue
Block a user