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 f11c93be01d7ae46318b0a448654beddbc2b995f..e8910cbfa8b093e742f3ab7989a1fcba2e7263f0 100644 |
--- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp |
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp |
@@ -264,6 +264,13 @@ void ThreadState::cleanupMainThread() |
{ |
ASSERT(isMainThread()); |
+#if defined(LEAK_SANITIZER) |
+ // See comment below, clear out most garbage before releasing static |
+ // persistents should some of the finalizers depend on touching |
+ // these persistents. |
+ ThreadHeap::collectAllGarbage(); |
+#endif |
+ |
releaseStaticPersistentNodes(); |
#if defined(LEAK_SANITIZER) |