projects
/
platform
/
upstream
/
libgee.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4df3e3a
)
Fix memory leak in LinkedList.clear
author
Jürg Billeter
<j@bitron.ch>
Fri, 28 Jan 2011 17:28:49 +0000
(18:28 +0100)
committer
Jürg Billeter
<j@bitron.ch>
Fri, 28 Jan 2011 17:30:14 +0000
(18:30 +0100)
Based on patch by Travis Reitter, fixes bug 639254.
gee/linkedlist.vala
patch
|
blob
|
history
diff --git
a/gee/linkedlist.vala
b/gee/linkedlist.vala
index
cc64f0b
..
9cb2d0b
100644
(file)
--- a/
gee/linkedlist.vala
+++ b/
gee/linkedlist.vala
@@
-59,8
+59,7
@@
public class Gee.LinkedList<G> : AbstractList<G>, Queue<G>, Deque<G> {
}
~LinkedList () {
- while (_head != null)
- _remove_node (_head);
+ this.clear ();
}
/**
@@
-136,6
+135,10
@@
public class Gee.LinkedList<G> : AbstractList<G>, Queue<G>, Deque<G> {
* {@inheritDoc}
*/
public override void clear () {
+ while (_head != null) {
+ _remove_node (_head);
+ }
+
++this._stamp;
this._head = null;
this._tail = null;