Bug 1646996 - Proxy to main thread in ~DocGroup. r=smaug

When destroying the DocGroup, it will most certainly have no documents
attached to it, which makes labelling them a strange thing to do. And
the event target in DocGroup would most certainly dispatch to release
on the main thread anyway, so switch to do that right away.

Differential Revision: https://phabricator.services.mozilla.com/D88538
This commit is contained in:
Andreas Farre
2020-08-28 10:14:39 +00:00
parent f7c7e54627
commit c0913cffc3

View File

@@ -186,11 +186,10 @@ DocGroup::~DocGroup() {
MOZ_RELEASE_ASSERT(!mBrowsingContextGroup);
if (!NS_IsMainThread()) {
nsIEventTarget* target = EventTargetFor(TaskCategory::Other);
NS_ProxyRelease("DocGroup::mReactionsStack", target,
mReactionsStack.forget());
NS_ReleaseOnMainThread("DocGroup::mReactionsStack",
mReactionsStack.forget());
NS_ProxyRelease("DocGroup::mArena", target, mArena.forget());
NS_ReleaseOnMainThread("DocGroup::mArena", mArena.forget());
}
if (mIframePostMessageQueue) {