зеркало из https://github.com/mozilla/gecko-dev.git
Bug 958684 - Fix AsyncErrorReporter leak in Promises. r=mccr8
This commit is contained in:
Родитель
f766dd3c2d
Коммит
97292b87fc
|
@ -561,12 +561,16 @@ Promise::MaybeReportRejected()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now post an event to do the real reporting async
|
// Now post an event to do the real reporting async
|
||||||
NS_DispatchToMainThread(
|
// Since Promises preserve their wrapper, it is essential to nsRefPtr<> the
|
||||||
|
// AsyncErrorReporter, otherwise if the call to DispatchToMainThread fails, it
|
||||||
|
// will leak. See Bug 958684.
|
||||||
|
nsRefPtr<AsyncErrorReporter> r =
|
||||||
new AsyncErrorReporter(JS_GetObjectRuntime(&mResult.toObject()),
|
new AsyncErrorReporter(JS_GetObjectRuntime(&mResult.toObject()),
|
||||||
report,
|
report,
|
||||||
nullptr,
|
nullptr,
|
||||||
isChromeError,
|
isChromeError,
|
||||||
win));
|
win);
|
||||||
|
NS_DispatchToMainThread(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Загрузка…
Ссылка в новой задаче