GNOME Bugzilla – Bug 618750
Creating a Gtk.Window with GLib.Object.new is broken
Last modified: 2010-08-20 07:44:45 UTC
Created attachment 161145 [details] test case The return value of g_object_new (GTK_TYPE_WINDOW, "type", GTK_WNDOW_TOPLEVEL, NULL) apparently needs to have g_object_ref_sink called on it, but that isn't happening because the result of the generated g_object_is_floating call is false. Running the attached test case will show the problem, but if you tweak the generated C so that g_object_ref_sink is called, everything seems to work.
A way to fix this is to check whether a type is subclass of InitiallyUnowned instead of using g_object_is_floating. Any thoughts?
Isn't that a GTK bug?
Created attachment 167377 [details] [review] Fix ref-sink GLib.InitiallyUnowned created with Object.new. Fixes bug 618750.
commit 583c88c1ab05c86753405a658a61e1939d026f1b Author: Luca Bruno <lethalman88@gmail.com> Date: Fri Aug 20 09:39:23 2010 +0200 Fix ref_sink of Gtk.Window created with GLib.Object.new Fixes bug 618750.