[vala/0.10] Call ref_sink also on result of Object.newv if necessary



commit 247b2afe1bd761dff07dd4236542efedc0e43e74
Author: Jürg Billeter <j bitron ch>
Date:   Fri Aug 20 09:46:29 2010 +0200

    Call ref_sink also on result of Object.newv if necessary

 codegen/valagobjectmodule.vala |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagobjectmodule.vala b/codegen/valagobjectmodule.vala
index d295289..238411b 100644
--- a/codegen/valagobjectmodule.vala
+++ b/codegen/valagobjectmodule.vala
@@ -782,7 +782,8 @@ public class Vala.GObjectModule : GTypeModule {
 	public override void visit_method_call (MethodCall expr) {
 		if (expr.call is MemberAccess) {
 			var ma = expr.call as MemberAccess;
-			if (ma.inner != null && ma.inner.symbol_reference == gobject_type && ma.member_name == "new") {
+			if (ma.inner != null && ma.inner.symbol_reference == gobject_type &&
+			    (ma.member_name == "new" || ma.member_name == "newv")) {
 				// Object.new (...) creation
 				// runtime check to ref_sink the instance if it's a floating type
 				base.visit_method_call (expr);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]