Bug 1820723 - do not create wakelock if XPCOM has started shutdown. r=media-playback-reviewers,jolin

Differential Revision: https://phabricator.services.mozilla.com/D172031
This commit is contained in:
alwu
2023-03-09 18:08:43 +00:00
parent 112a332fd9
commit db08a6d91a
2 changed files with 6 additions and 0 deletions

View File

@@ -4601,6 +4601,9 @@ void HTMLMediaElement::UpdateWakeLock() {
}
void HTMLMediaElement::CreateAudioWakeLockIfNeeded() {
if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownConfirmed)) {
return;
}
if (!mWakeLock) {
RefPtr<power::PowerManagerService> pmService =
power::PowerManagerService::GetInstance();