mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 864322 - Stop all audio buffer source nodes when the context is being shut down to prevent leaks in the graph; r=padenot
--HG-- extra : rebase_source : a64d445609ac9892d0fae36122fdc25e1437f400
This commit is contained in:
parent
661070f9c5
commit
95796cdc83
@ -274,6 +274,20 @@ AudioContext::CurrentTime() const
|
||||
return MediaTimeToSeconds(Destination()->Stream()->GetCurrentTime());
|
||||
}
|
||||
|
||||
void
|
||||
AudioContext::Shutdown()
|
||||
{
|
||||
Suspend();
|
||||
mDecoder.Shutdown();
|
||||
|
||||
// Stop all audio buffer source nodes, to make sure that they release
|
||||
// their self-references.
|
||||
for (uint32_t i = 0; i < mAudioBufferSourceNodes.Length(); ++i) {
|
||||
ErrorResult rv;
|
||||
mAudioBufferSourceNodes[i]->Stop(0.0, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioContext::Suspend()
|
||||
{
|
||||
|
@ -65,12 +65,7 @@ public:
|
||||
return mWindow;
|
||||
}
|
||||
|
||||
void Shutdown()
|
||||
{
|
||||
Suspend();
|
||||
mDecoder.Shutdown();
|
||||
}
|
||||
|
||||
void Shutdown();
|
||||
void Suspend();
|
||||
void Resume();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user