Bug 1477767 - disconnect request when XPCOM is going to shutdown. r=cpearce
The reason we hit this assertion is that we still connected to Then() and waited for its result when the resolve or reject runnable which dispatched by ThenValue can't be executed because the target thread had been shutdown. Therefore, when XPCOM is going to shutdown, we should disconnect the Then() because it might not have a chance to execute its resolve/reject method. Differential Revision: https://phabricator.services.mozilla.com/D5893
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user