From 5806b970bef219a8b87d7e384b0c3a589d22429e Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Thu, 4 Oct 2012 00:44:50 -0400 Subject: [PATCH] Bug 797515 - Fix race condition in assertion in ContentParent::~ContentParent. r=cjones --- dom/ipc/ContentParent.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 13c4415cfcf..da9989ef6da 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -774,8 +774,12 @@ ContentParent::~ContentParent() MOZ_ASSERT(!gNonAppContentParents || !gNonAppContentParents->Contains(this)); } else { + // In general, we expect gAppContentParents->Get(mAppManifestURL) to be + // NULL. But it could be that we created another ContentParent for this + // app after we did this->ActorDestroy(), so the right check is that + // gAppContentParent->Get(mAppManifestURL) != this. MOZ_ASSERT(!gAppContentParents || - !gAppContentParents->Get(mAppManifestURL)); + gAppContentParents->Get(mAppManifestURL) != this); } }