Skip to content

Commit

Permalink
Bug 1579858 - Should release RefPtr before CollectData is clear; r=sm…
Browse files Browse the repository at this point in the history
…aug a=RyanVM

mAboutToBeNotifiedRejectedPromises will be clear in AfterProcessMicrotasks()
and mPendingUnhandledRejections will be clear after NotifyUnhandledRejections
runnable is handled.

However, worker could terminate in any time, we still need to clear those
structures manually before CollectData is clear.

Differential Revision: https://phabricator.services.mozilla.com/D46095

--HG--
extra : source : 9596d7f4a7457bccc78cadf9c39bcc9c4b5b97f8
extra : intermediate-source : fffca6c7380a0e0e412887d596349df5e9e19460
  • Loading branch information
EdgarChen committed Sep 17, 2019
1 parent 5be604c commit 43b347e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xpcom/base/CycleCollectedJSContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ CycleCollectedJSContext::~CycleCollectedJSContext() {
mUncaughtRejections.reset();
mConsumedRejections.reset();

mAboutToBeNotifiedRejectedPromises.Clear();
mPendingUnhandledRejections.Clear();

JS_DestroyContext(mJSContext);
mJSContext = nullptr;

Expand Down

0 comments on commit 43b347e

Please sign in to comment.