From 553c22e6e69f9c9f760b8bb2eeb2696fda91053c Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Fri, 26 Oct 2012 11:07:59 +1300 Subject: [PATCH] Bug 790854. Set mMainThreadDestroyed before the stream is destroyed. r=jesup --HG-- extra : rebase_source : 6b1d2a64b9af082b02a207759f051cb6d7975e35 --- content/media/MediaStreamGraph.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/media/MediaStreamGraph.cpp b/content/media/MediaStreamGraph.cpp index f190b99ee2e..5a5b095a097 100644 --- a/content/media/MediaStreamGraph.cpp +++ b/content/media/MediaStreamGraph.cpp @@ -1798,8 +1798,9 @@ MediaStream::Destroy() { Run(); } }; mWrapper = nullptr; - GraphImpl()->AppendMessage(new Message(this)); mMainThreadDestroyed = true; + GraphImpl()->AppendMessage(new Message(this)); + // 'this' can be dead after the AppendMessage, so don't touch it here. } void