mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
b=916680 don't keep active AudioNodes alive from an AudioContext that has shut down r=ehsan
--HG-- extra : transplant_source : %20%3Fl%E0%D7R%7B_%E6%B0%C7%BB%3A%E7%21%9D%F1%A2%F4%1C
This commit is contained in:
parent
7445da2394
commit
24edb394d3
@ -60,6 +60,7 @@ AudioContext::AudioContext(nsPIDOMWindow* aWindow,
|
||||
, mNumberOfChannels(aNumberOfChannels)
|
||||
, mIsOffline(aIsOffline)
|
||||
, mIsStarted(!aIsOffline)
|
||||
, mIsShutDown(false)
|
||||
{
|
||||
// Actually play audio
|
||||
mDestination->Stream()->AddAudioOutput(&gWebAudioOutputKey);
|
||||
@ -443,7 +444,9 @@ AudioContext::RemoveFromDecodeQueue(WebAudioDecodeJob* aDecodeJob)
|
||||
void
|
||||
AudioContext::RegisterActiveNode(AudioNode* aNode)
|
||||
{
|
||||
mActiveNodes.PutEntry(aNode);
|
||||
if (!mIsShutDown) {
|
||||
mActiveNodes.PutEntry(aNode);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -536,6 +539,8 @@ GetHashtableElements(nsTHashtable<nsPtrHashKey<T> >& aHashtable, nsTArray<T*>& a
|
||||
void
|
||||
AudioContext::Shutdown()
|
||||
{
|
||||
mIsShutDown = true;
|
||||
|
||||
Suspend();
|
||||
|
||||
// Release references to active nodes.
|
||||
|
@ -270,6 +270,7 @@ private:
|
||||
uint32_t mNumberOfChannels;
|
||||
bool mIsOffline;
|
||||
bool mIsStarted;
|
||||
bool mIsShutDown;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user