Bug 1749308 - Don't attempt to send a message to the graph after a ScriptProcessorNode has been marked for collection. r=karlt

Differential Revision: https://phabricator.services.mozilla.com/D135612
This commit is contained in:
Paul Adenot 2022-01-31 10:17:04 +00:00
parent dae26c566f
commit 5dc3029a55
3 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<script>
window.addEventListener("load", () => {
const context = new AudioContext({})
const controller = new AbortController()
let processor = context.createScriptProcessor(512, 27, 2)
processor.addEventListener("audioprocess", async () => {}, { signal: controller.signal })
processor = null;
SpecialPowers.forceGC()
for (let i = 0; i < 7; i++) {
controller.abort();
}
})
</script>
</head>
</html>

View File

@ -35,3 +35,4 @@ load 1576938.html
skip-if(Android) pref(media.getusermedia.audiocapture.enabled,true) load 1573536.html
skip-if(!Android) pref(media.getusermedia.audiocapture.enabled,true) pref(media.navigator.permission.device,false) load 1573536.html # media.navigator.permission.device is mobile-only, so other platforms fail to set it (Bug 1350948)
load 1594136.html
load 1749308.html

View File

@ -505,7 +505,7 @@ void ScriptProcessorNode::EventListenerAdded(nsAtom* aType) {
void ScriptProcessorNode::EventListenerRemoved(nsAtom* aType) {
AudioNode::EventListenerRemoved(aType);
if (aType == nsGkAtoms::onaudioprocess) {
if (aType == nsGkAtoms::onaudioprocess && mTrack) {
UpdateConnectedStatus();
}
}