Skip to content

Commit

Permalink
Oilpan: Clear all Persistents on thread termination.
Browse files Browse the repository at this point in the history
Persistents should be cleared when NumberOfPersistents() != 0.

Bug: 831117
Change-Id: Ie6209d822c1d14a79936cb2807f1da7e559a42b2
Reviewed-on: https://chromium-review.googlesource.com/1089460
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Keishi Hattori <keishi@chromium.org>
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565144}
  • Loading branch information
lucasgadani authored and Commit Bot committed Jun 7, 2018
1 parent 966f8eb commit 6ffac3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions third_party/blink/renderer/platform/heap/thread_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ void ThreadState::RunTerminationGC() {
// if we have it is a bug, and we have a reference cycle or a missing
// RegisterAsStaticReference. Clearing out all the Persistents will avoid
// stale pointers and gets them reported as nullptr dereferences.
if (!current_count) {
if (current_count) {
for (size_t i = 0; i < kMaxTerminationGCLoops &&
GetPersistentRegion()->NumberOfPersistents();
i++) {
Expand All @@ -259,7 +259,7 @@ void ThreadState::RunTerminationGC() {
}
}

DCHECK(!GetPersistentRegion()->NumberOfPersistents());
CHECK(!GetPersistentRegion()->NumberOfPersistents());

// All of pre-finalizers should be consumed.
DCHECK(ordered_pre_finalizers_.IsEmpty());
Expand Down

0 comments on commit 6ffac3d

Please sign in to comment.