Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Unified Diff: third_party/WebKit/Source/platform/heap/Persistent.h

Issue 2423743003: Stop calling Persistent::uninitialize after blink::shutdown is called. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/Persistent.h
diff --git a/third_party/WebKit/Source/platform/heap/Persistent.h b/third_party/WebKit/Source/platform/heap/Persistent.h
index 36539c7efee59f111a0f3b4660e7ed5291eaf188..d75044be3019b76d627e3c72f133a09d1f9e3b25 100644
--- a/third_party/WebKit/Source/platform/heap/Persistent.h
+++ b/third_party/WebKit/Source/platform/heap/Persistent.h
@@ -227,6 +227,14 @@ class PersistentBase {
}
void uninitialize() {
+ // TODO(haraken): This is a short-term hack to prevent use-after-frees
+ // during a shutdown sequence.
+ // 1) blink::shutdown() frees the underlying storage for persistent nodes.
+ // 2) ~MessageLoop() destructs some Chromium-side objects that hold
+ // Persistent. It touches the underlying storage and crashes.
+ if (WTF::isShutdown())
+ return;
+
if (crossThreadnessConfiguration == CrossThreadPersistentConfiguration) {
if (acquireLoad(reinterpret_cast<void* volatile*>(&m_persistentNode)))
ProcessHeap::crossThreadPersistentRegion().freePersistentNode(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698