diff options
Diffstat (limited to 'runtime/gc')
-rw-r--r-- | runtime/gc/heap.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index f2919e8..7235729 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -1331,11 +1331,6 @@ 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? @@ -1345,6 +1340,12 @@ void Heap::TransitionCollector(CollectorType collector_type) { } usleep(1000); } + 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. + FinishGC(self, collector::kGcTypeNone); + return; + } tl->SuspendAll(); switch (collector_type) { case kCollectorTypeSS: |