From fead26c06f5667b72cecd41ee4bcc81908dfc12a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrg=20Billeter?= Date: Fri, 28 Jan 2011 18:28:49 +0100 Subject: [PATCH] Fix memory leak in LinkedList.clear Based on patch by Travis Reitter, fixes bug 639254. --- gee/linkedlist.vala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gee/linkedlist.vala b/gee/linkedlist.vala index cc64f0b..9cb2d0b 100644 --- a/gee/linkedlist.vala +++ b/gee/linkedlist.vala @@ -59,8 +59,7 @@ public class Gee.LinkedList : AbstractList, Queue, Deque { } ~LinkedList () { - while (_head != null) - _remove_node (_head); + this.clear (); } /** @@ -136,6 +135,10 @@ public class Gee.LinkedList : AbstractList, Queue, Deque { * {@inheritDoc} */ public override void clear () { + while (_head != null) { + _remove_node (_head); + } + ++this._stamp; this._head = null; this._tail = null; -- 2.7.4