Commit 5bd39433 authored by Edgar Chen's avatar Edgar Chen
Browse files

Bug 1579858 - Should release RefPtr before CollectData is clear; r=smaug

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 : moz-landing-system : lando
parent 51aefb37
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -103,6 +103,9 @@ CycleCollectedJSContext::~CycleCollectedJSContext() {
  mUncaughtRejections.reset();
  mConsumedRejections.reset();

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

  JS_DestroyContext(mJSContext);
  mJSContext = nullptr;