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:
Ehsan Akhgari 2013-04-22 11:45:34 -04:00
parent 661070f9c5
commit 95796cdc83
2 changed files with 15 additions and 6 deletions

View File

@ -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()
{

View File

@ -65,12 +65,7 @@ public:
return mWindow;
}
void Shutdown()
{
Suspend();
mDecoder.Shutdown();
}
void Shutdown();
void Suspend();
void Resume();