Chromium Code Reviews| Index: third_party/WebKit/Source/platform/heap/ThreadState.cpp |
| diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.cpp b/third_party/WebKit/Source/platform/heap/ThreadState.cpp |
| index beaaf3042c88d209bcfb248d590ff952b36e8035..6c5c2fdcb6b5d514fc8abb9aff2bb39c36bca868 100644 |
| --- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp |
| +++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp |
| @@ -213,6 +213,18 @@ void ThreadState::cleanupMainThread() |
| { |
| ASSERT(isMainThread()); |
| +#if defined(LEAK_SANITIZER) |
| + // If LSan is about to perform leak detection, release all the registered |
| + // static Persistent<> root references to global caches that Blink keeps, |
| + // followed by GCs to clear out all they referred to. |
|
haraken
2016/03/11 09:18:05
I forgot the details about this.
Why is it okay t
sof
2016/03/11 09:36:18
For the purposes of overall leak detection, we are
|
| + // |
| + // This is not needed for caches over non-Oilpan objects, as they're |
| + // not scanned by LSan due to being held in non-global storage |
| + // ("static" references inside functions/methods.) |
| + releaseStaticPersistentNodes(); |
| + Heap::collectAllGarbage(); |
| +#endif |
| + |
| // Finish sweeping before shutting down V8. Otherwise, some destructor |
| // may access V8 and cause crashes. |
| completeSweep(); |