static void rclosure_invalidate(G_GNUC_UNUSED gpointer data, GClosure *closure) { GRClosure *rclosure = (GRClosure*)closure; if (rclosure->count > 0) { GList *next; rclosure->count = 1; for (next = rclosure->objects; next; next = next->next) { GObject *object = G_OBJECT(next->data); VALUE obj = rbgobj_ruby_object_from_instance2(object, FALSE); if (!NIL_P(rclosure->rb_holder) && !NIL_P(obj)) G_REMOVE_RELATIVE(obj, id_closures, rclosure->rb_holder); } rclosure_unref(rclosure); } }
VALUE rbgobj_ruby_object_from_instance(gpointer instance) { return rbgobj_ruby_object_from_instance2(instance, TRUE); }
void rbgobj_gc_mark_instance(gpointer instance) { VALUE obj = rbgobj_ruby_object_from_instance2(instance, FALSE); rb_gc_mark(obj); }