[libgee/0.6] Fix memory leak in TreeSet and TreeMap
- From: Maciej Marcin Piechotka <mpiechotka src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgee/0.6] Fix memory leak in TreeSet and TreeMap
- Date: Mon, 4 Mar 2013 17:05:49 +0000 (UTC)
commit c9bdc62e0b726137cdf78f2ea60ac59e83759ef7
Author: Maciej Piechotka <uzytkownik2 gmail com>
Date: Mon Mar 4 17:05:11 2013 +0000
Fix memory leak in TreeSet and TreeMap
gee/treemap.vala | 4 ++++
gee/treeset.vala | 4 ++++
2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gee/treemap.vala b/gee/treemap.vala
index 8b3917e..a300a3e 100644
--- a/gee/treemap.vala
+++ b/gee/treemap.vala
@@ -121,6 +121,10 @@ public class Gee.TreeMap<K,V> : Gee.AbstractMap<K,V> {
this.value_equal_func = value_equal_func;
}
+ ~TreeMap () {
+ clear ();
+ }
+
private void rotate_right (ref Node<K, V> root) {
Node<K,V> pivot = (owned) root.left;
pivot.color = root.color;
diff --git a/gee/treeset.vala b/gee/treeset.vala
index 3548cf1..d380b87 100644
--- a/gee/treeset.vala
+++ b/gee/treeset.vala
@@ -63,6 +63,10 @@ public class Gee.TreeSet<G> : AbstractSet<G>, SortedSet<G> {
this.compare_func = compare_func;
}
+ ~TreeSet () {
+ clear ();
+ }
+
/**
* { inheritDoc}
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]