mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-30 13:53:30 +02:00
incorporated huge docu patch from Eric Lemings <eric.b.lemings@lmco.com>
Fri Feb 16 06:52:20 2001 Tim Janik <timj@gtk.org> * gobject/tmpl/types.sgml: incorporated huge docu patch from Eric Lemings <eric.b.lemings@lmco.com> with a bunch of editing on my part. Fri Feb 16 07:10:44 2001 Tim Janik <timj@gtk.org> * gclosure.c: (g_closure_ref): (g_closure_sink): make closure sinking explicit. * gsignal.c: (g_signal_connect_data): (g_signal_connect_closure): (g_signal_connect_closure_by_id): (g_signal_newv): perform explicit closure sinking. Thu Feb 8 00:31:45 2001 Tim Janik <timj@gtk.org> * gtype.h: added G_TYPE_DEBUG_NONE for/from Eric Lemings ;)
This commit is contained in:
@@ -311,14 +311,7 @@ g_closure_ref (GClosure *closure)
|
||||
g_return_val_if_fail (closure->ref_count > 0, NULL);
|
||||
g_return_val_if_fail (closure->ref_count < CLOSURE_MAX_REF_COUNT, NULL);
|
||||
|
||||
/* floating is basically a kludge to avoid creating closures
|
||||
* with a ref_count of 0. so the first one doing _ref() will
|
||||
* own the closure's initial ref_count
|
||||
*/
|
||||
if (closure->floating)
|
||||
closure->floating = FALSE;
|
||||
else
|
||||
closure->ref_count += 1;
|
||||
closure->ref_count += 1;
|
||||
|
||||
return closure;
|
||||
}
|
||||
@@ -356,6 +349,27 @@ g_closure_unref (GClosure *closure)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
g_closure_sink (GClosure *closure)
|
||||
{
|
||||
g_return_if_fail (closure != NULL);
|
||||
g_return_if_fail (closure->ref_count > 0);
|
||||
|
||||
/* floating is basically a kludge to avoid creating closures
|
||||
* with a ref_count of 0. so the intial ref_count a closure has
|
||||
* is unowned. with invoking g_closure_sink() code may
|
||||
* indicate that it takes over that intiial ref_count.
|
||||
*/
|
||||
if (closure->floating)
|
||||
{
|
||||
closure->floating = FALSE;
|
||||
if (closure->ref_count > 1)
|
||||
closure->ref_count -= 1;
|
||||
else
|
||||
g_closure_unref (closure);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
g_closure_remove_inotify (GClosure *closure,
|
||||
gpointer notify_data,
|
||||
|
Reference in New Issue
Block a user