mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 06:15:43 +00:00
Bug 790854. Keep MediaStream alive until MediaStream::Destroy ends. r=jesup
This commit is contained in:
parent
3651217462
commit
52d8418d94
@ -1786,6 +1786,9 @@ MediaStream::DestroyImpl()
|
||||
void
|
||||
MediaStream::Destroy()
|
||||
{
|
||||
// Keep this stream alive until we leave this method
|
||||
nsRefPtr<MediaStream> kungFuDeathGrip = this;
|
||||
|
||||
class Message : public ControlMessage {
|
||||
public:
|
||||
Message(MediaStream* aStream) : ControlMessage(aStream) {}
|
||||
@ -1799,6 +1802,9 @@ MediaStream::Destroy()
|
||||
};
|
||||
mWrapper = nullptr;
|
||||
GraphImpl()->AppendMessage(new Message(this));
|
||||
// Message::RunDuringShutdown may have removed this stream from the graph,
|
||||
// but our kungFuDeathGrip above will have kept this stream alive if
|
||||
// necessary.
|
||||
mMainThreadDestroyed = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user