diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-04-23 14:41:11 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-04-23 14:42:30 -0700 |
commit | 3c4a43469046934e76082a4cf1aca14429cd9735 (patch) | |
tree | f19f9daface730f297b8f592f601688271fb3e78 /runtime/gc | |
parent | de981b0c9124f0b1f29e18ea6b8cb8328f561aab (diff) | |
download | art-3c4a43469046934e76082a4cf1aca14429cd9735.zip art-3c4a43469046934e76082a4cf1aca14429cd9735.tar.gz art-3c4a43469046934e76082a4cf1aca14429cd9735.tar.bz2 |
Don't allow heap transitions if the runtime is shutting down.
Bug: 14254222
Change-Id: I97ac988a96b56a8dc1eec018bf3ef7a691f04745
Diffstat (limited to 'runtime/gc')
-rw-r--r-- | runtime/gc/heap.cc | 5 |
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? |