[libgee] Fix memory leak in default implementation of foreach and fold



commit 8f601491c1fa3ee55be892c49dca0225476a6606
Author: Maciej Piechotka <uzytkownik2 gmail com>
Date:   Sat Apr 30 12:54:31 2011 +0200

    Fix memory leak in default implementation of foreach and fold

 gee/iterator.vala |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gee/iterator.vala b/gee/iterator.vala
index 563a2dd..0a286d0 100644
--- a/gee/iterator.vala
+++ b/gee/iterator.vala
@@ -25,8 +25,8 @@
  */
 
 namespace Gee {
-	public delegate A FoldFunc<A, G> (G g, owned A a);
-	public delegate void ForallFunc<G> (G g);
+	public delegate A FoldFunc<A, G> (owned G g, owned A a);
+	public delegate void ForallFunc<G> (owned G g);
 }
 
 /**
@@ -95,7 +95,7 @@ public interface Gee.Iterator<G> : Object {
 	 */
 	public virtual A fold<A> (FoldFunc<A, G> f, owned A seed)
 	{
-		this.foreach ((item) => {seed = f (item, (owned) seed);});
+		this.foreach ((item) => {seed = f ((owned) item, (owned) seed);});
 		return (owned) seed;
 	}
 	



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