]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
GError: Use destroy_value in return_with_exception
authorLuca Bruno <lucabru@src.gnome.org>
Wed, 4 May 2011 20:16:58 +0000 (22:16 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Wed, 4 May 2011 20:16:58 +0000 (22:16 +0200)
codegen/valagerrormodule.vala

index 848363614b58d75f066ceb71efaccccbaea16d53..bcc4f6d050df86720ceea4dbd78842eaf566e559 100644 (file)
@@ -104,8 +104,7 @@ public class Vala.GErrorModule : CCodeDelegateModule {
 
                if (current_method is CreationMethod && current_method.parent_symbol is Class) {
                        var cl = (Class) current_method.parent_symbol;
-                       var unref_call = get_unref_expression (new CCodeIdentifier ("self"), new ObjectType (cl), null);
-                       ccode.add_expression (unref_call);
+                       ccode.add_expression (destroy_value (new GLibValue (new ObjectType (cl), new CCodeIdentifier ("self"))));
                        ccode.add_return (new CCodeConstant ("NULL"));
                } else if (is_in_coroutine ()) {
                        ccode.add_return (new CCodeConstant ("FALSE"));