]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix ref_sink of Gtk.Window created with GLib.Object.new
authorLuca Bruno <lethalman88@gmail.com>
Fri, 20 Aug 2010 07:39:23 +0000 (09:39 +0200)
committerJürg Billeter <j@bitron.ch>
Fri, 20 Aug 2010 08:17:21 +0000 (10:17 +0200)
Fixes bug 618750.

codegen/valagobjectmodule.vala

index 59ef5ee2c52853f2e876031d857a8c40a497e2d6..d295289ba23b342289589ade0627c847b4db14e0 100644 (file)
@@ -792,11 +792,11 @@ public class Vala.GObjectModule : GTypeModule {
                                temp_vars.add (temp_var);
                                ccomma.append_expression (new CCodeAssignment (get_variable_cexpression (temp_var.name), (CCodeExpression) expr.ccodenode));
 
-                               var is_floating_ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_object_is_floating"));
-                               is_floating_ccall.add_argument (get_variable_cexpression (temp_var.name));
+                               var initiallyunowned_ccall = new CCodeFunctionCall (new CCodeIdentifier ("G_IS_INITIALLY_UNOWNED"));
+                               initiallyunowned_ccall.add_argument (get_variable_cexpression (temp_var.name));
                                var sink_ref_ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_object_ref_sink"));
                                sink_ref_ccall.add_argument (get_variable_cexpression (temp_var.name));
-                               ccomma.append_expression (new CCodeConditionalExpression (is_floating_ccall, sink_ref_ccall, get_variable_cexpression (temp_var.name)));
+                               ccomma.append_expression (new CCodeConditionalExpression (initiallyunowned_ccall, sink_ref_ccall, get_variable_cexpression (temp_var.name)));
 
                                expr.ccodenode = ccomma;
                                return;