Bug 974089 - Destroy the streams from the main thread.

This commit is contained in:
Paul Adenot 2015-06-11 18:46:44 +02:00
parent f0186a2c09
commit 944dbb4078
2 changed files with 10 additions and 6 deletions

View File

@ -729,6 +729,11 @@ AudioBufferSourceNode::NotifyMainThreadStreamFinished()
}
mNode->DispatchTrustedEvent(NS_LITERAL_STRING("ended"));
// Release stream resources.
//
// DestroyMediaStream() will remove this stream listener.
mNode->DestroyMediaStream();
return NS_OK;
}
private:
@ -736,9 +741,6 @@ AudioBufferSourceNode::NotifyMainThreadStreamFinished()
};
NS_DispatchToMainThread(new EndedEventDispatcher(this));
// Release stream resources.
// DestroyMediaStream() will remove this stream listener.
DestroyMediaStream();
// Drop the playing reference
// Warning: The below line might delete this.

View File

@ -538,6 +538,11 @@ OscillatorNode::NotifyMainThreadStreamFinished()
}
mNode->DispatchTrustedEvent(NS_LITERAL_STRING("ended"));
// Release stream resources.
// DestroyMediaStream() will remove this stream listener.
mNode->DestroyMediaStream();
return NS_OK;
}
private:
@ -545,9 +550,6 @@ OscillatorNode::NotifyMainThreadStreamFinished()
};
NS_DispatchToMainThread(new EndedEventDispatcher(this));
// Release stream resources.
// DestroyMediaStream() will remove this stream listener.
DestroyMediaStream();
// Drop the playing reference
// Warning: The below line might delete this.