diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-07-24 11:11:05 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-07-24 13:16:19 -0700 |
commit | 5189e24fb6d42c04c48169ab2f15de56ecf3c828 (patch) | |
tree | 41998e361eed7cfec1e4d84a06dac6ee26f6167e /runtime | |
parent | 7521704fef0c0ce302f3c36749cb6c830cb6b569 (diff) | |
download | art-5189e24fb6d42c04c48169ab2f15de56ecf3c828.zip art-5189e24fb6d42c04c48169ab2f15de56ecf3c828.tar.gz art-5189e24fb6d42c04c48169ab2f15de56ecf3c828.tar.bz2 |
Fix memory leak in RemoveRememberedSet.
RemoveRememberedSet now deletes the remembered set.
Bug: 16532086
Change-Id: I01092931cc20cd0688dd42eed3dde9ad140889b2
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/gc/heap.cc | 1 | ||||
-rw-r--r-- | runtime/gc/heap.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index 1b9b077..d6cf52f 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -3118,6 +3118,7 @@ void Heap::RemoveRememberedSet(space::Space* space) { CHECK(space != nullptr); auto it = remembered_sets_.find(space); CHECK(it != remembered_sets_.end()); + delete it->second; remembered_sets_.erase(it); CHECK(remembered_sets_.find(space) == remembered_sets_.end()); } diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h index 56c6d6d..8ffadd5 100644 --- a/runtime/gc/heap.h +++ b/runtime/gc/heap.h @@ -572,6 +572,7 @@ class Heap { accounting::RememberedSet* FindRememberedSetFromSpace(space::Space* space); void AddRememberedSet(accounting::RememberedSet* remembered_set); + // Also deletes the remebered set. void RemoveRememberedSet(space::Space* space); bool IsCompilingBoot() const; |