Bug 1938220 - Early return NS_OK of GlobalTeardownObserver::CheckCurrentGlobalCorrectness() when is on the main thread. a=RyanVM DONTBUILD

Original Revision: https://phabricator.services.mozilla.com/D258192

Differential Revision: https://phabricator.services.mozilla.com/D262897
This commit is contained in:
Eden Chuang
2025-08-28 12:27:42 +00:00
committed by rvandermeulen@mozilla.com
parent cc71f694e8
commit 6bc6572d0f

View File

@@ -64,7 +64,13 @@ nsresult GlobalTeardownObserver::CheckCurrentGlobalCorrectness() const {
}
}
if (mParentObject->IsDying() && !NS_IsMainThread()) {
if (NS_IsMainThread()) {
return NS_OK;
}
// Not on main thread, might check if is on the global's owning thread before
// calling IsDying().
if (mParentObject->IsDying()) {
return NS_ERROR_FAILURE;
}