vala r825 - in trunk: . vala



Author: juergbi
Date: Thu Jan 10 09:29:59 2008
New Revision: 825
URL: http://svn.gnome.org/viewvc/vala?rev=825&view=rev

Log:
2008-01-10  Juerg Billeter  <j bitron ch>

	* vala/valamemorymanager.vala: fix memory management of property
	  getters with ownership transfer, fixes bug 505713


Modified:
   trunk/ChangeLog
   trunk/vala/valamemorymanager.vala

Modified: trunk/vala/valamemorymanager.vala
==============================================================================
--- trunk/vala/valamemorymanager.vala	(original)
+++ trunk/vala/valamemorymanager.vala	Thu Jan 10 09:29:59 2008
@@ -1,6 +1,6 @@
 /* valamemorymanager.vala
  *
- * Copyright (C) 2006-2007  JÃrg Billeter, Raffaele Sandrini
+ * Copyright (C) 2006-2008  JÃrg Billeter, Raffaele Sandrini
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -171,9 +171,16 @@
 						visit_possibly_leaked_expression (stmt.return_expression);
 					}
 				}
-			} else {
+			} else if (current_symbol is Property) {
 				/* property get accessor */
-				visit_possibly_leaked_expression (stmt.return_expression);
+				var prop = (Property) current_symbol;
+				if (prop.type_reference.transfers_ownership) {
+					visit_possibly_missing_copy_expression (stmt.return_expression);
+				} else {
+					visit_possibly_leaked_expression (stmt.return_expression);
+				}
+			} else {
+				assert_not_reached ();
 			}
 		}
 	}



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