зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1127188 - Null-check the destination in AudioContext::Close, since it can now be called after the graph is dead. r=ehsan
This commit is contained in:
Родитель
0ab779951a
Коммит
776849a603
|
@ -912,14 +912,18 @@ AudioContext::Close(ErrorResult& aRv)
|
|||
mCloseCalled = true;
|
||||
|
||||
mPromiseGripArray.AppendElement(promise);
|
||||
Graph()->ApplyAudioContextOperation(DestinationStream()->AsAudioNodeStream(),
|
||||
AudioContextOperation::Close, promise);
|
||||
|
||||
// This can be called when freeing a document, and the streams are dead at
|
||||
// this point, so we need extra null-checks.
|
||||
MediaStream* ds = DestinationStream();
|
||||
if (ds) {
|
||||
ds->BlockStreamIfNeeded();
|
||||
}
|
||||
Graph()->ApplyAudioContextOperation(ds->AsAudioNodeStream(),
|
||||
AudioContextOperation::Close, promise);
|
||||
|
||||
if (ds) {
|
||||
ds->BlockStreamIfNeeded();
|
||||
}
|
||||
}
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче