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:
Tim Janik
2001-02-16 07:22:59 +00:00
committed by Tim Janik
parent efb2e89e07
commit 12a0d19c11
7 changed files with 406 additions and 171 deletions

View File

@@ -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,