summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-04-24 00:17:52 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-04-24 00:17:52 +0000
commitae55e6c0c6a6fa393742a00ac5b7748f9ce45344 (patch)
treebc1d340f75287038efb05cffa076d5478d8c469f /runtime
parent1c17753ca9cf125ffd1fa47f34650fb6f4005409 (diff)
parent3c4a43469046934e76082a4cf1aca14429cd9735 (diff)
downloadart-ae55e6c0c6a6fa393742a00ac5b7748f9ce45344.zip
art-ae55e6c0c6a6fa393742a00ac5b7748f9ce45344.tar.gz
art-ae55e6c0c6a6fa393742a00ac5b7748f9ce45344.tar.bz2
Merge "Don't allow heap transitions if the runtime is shutting down."
Diffstat (limited to 'runtime')
-rw-r--r--runtime/gc/heap.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 502da12..517c748 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -1432,6 +1432,11 @@ void Heap::TransitionCollector(CollectorType collector_type) {
if (collector_type == collector_type_) {
return;
}
+ if (Runtime::Current()->IsShuttingDown(self)) {
+ // Don't allow heap transitions to happen if the runtime is shutting down since these can
+ // cause objects to get finalized.
+ return;
+ }
// GC can be disabled if someone has a used GetPrimitiveArrayCritical but not yet released.
if (!copying_transition || disable_moving_gc_count_ == 0) {
// TODO: Not hard code in semi-space collector?