bug 1524478 - don't create JS objects from WebAuthnManager or U2F destructors r=qdot

Before this patch, the WebAuthnManager/U2F destructors would call MaybeReject on
existing transaction promises. Doing this leaks JS objects. If
WebAuthnManager/U2F are being destructed, though, the window is going away, so
it shouldn't be necessary to reject any outstanding promises. This patch just
clears the transactions.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dana Keeler 2019-04-12 18:18:57 +00:00
Родитель abbca7fd7d
Коммит 7c34defd31
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -140,7 +140,7 @@ U2F::~U2F() {
MOZ_ASSERT(NS_IsMainThread());
if (mTransaction.isSome()) {
RejectTransaction(NS_ERROR_ABORT);
ClearTransaction();
}
if (mChild) {

Просмотреть файл

@ -200,7 +200,7 @@ WebAuthnManager::~WebAuthnManager() {
MOZ_ASSERT(NS_IsMainThread());
if (mTransaction.isSome()) {
RejectTransaction(NS_ERROR_ABORT);
ClearTransaction();
}
if (mChild) {