diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index 2724450b479b..6f007dc02aaa 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -6798,6 +6798,9 @@ void HTMLMediaElement::NotifyShutdownEvent() { mShuttingDown = true; + // Since target thread had been shutdown, it's no chance to execute the Then() + // afterward. Therefore, we should disconnect the request. + mAutoplayPermissionRequest.DisconnectIfExists(); ResetState(); AddRemoveSelfReference(); }