hugopl/gi-crystal

Setting a GObject property to nil causes a runtime warning

hugopl opened this issue · 0 comments

The following code:

it "can be GObjects" do
  subject = Test::Subject.new
  subject.gobj.should eq(nil)

  value = Test::Subject.new
  subject.gobj = value
  value.ref_count.should eq(2)
  subject.gobj.not_nil!.to_unsafe.should eq(value.to_unsafe)

  subject.gobj = nil
  value.ref_count.should eq(1)
  subject.gobj.should eq(nil)
end