Skip to content

Commit

Permalink
glib2: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed May 5, 2018
1 parent e11ae27 commit e77f03b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions glib2/ext/glib2/rbgobj_closure.c
Expand Up @@ -290,18 +290,17 @@ g_rclosure_attach(GClosure *closure, VALUE object)
static VALUE cGLibObject = Qnil;
GRClosure *rclosure = (GRClosure *)closure;

rbgobj_add_relative(object, rclosure->rb_holder);

if (NIL_P(cGLibObject)) {
cGLibObject = rb_const_get(mGLib, rb_intern("Object"));
}
if (rb_obj_is_kind_of(object, cGLibObject)) {
GObject *gobject;
rbgobj_object_add_relative(object, rclosure->rb_holder);
gobject = RVAL2GOBJ(object);
rclosure->count++;
g_object_weak_ref(gobject, rclosure_weak_notify, rclosure);
rclosure->objects = g_list_prepend(rclosure->objects, gobject);
} else {
rbgobj_add_relative(object, rclosure->rb_holder);
}
}

Expand Down

0 comments on commit e77f03b

Please sign in to comment.