From 2e93916b83d5b1cc295c22ca1ba900f54dc62617 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Sat, 25 May 2013 10:01:08 -0400 Subject: [PATCH] Bug 875402 - Delete MediaInputPort objects using normal refcounting semantics; r=roc --- content/media/MediaStreamGraph.cpp | 7 +-- content/media/webaudio/test/Makefile.in | 1 + .../media/webaudio/test/test_bug875402.html | 46 +++++++++++++++++++ 3 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 content/media/webaudio/test/test_bug875402.html diff --git a/content/media/MediaStreamGraph.cpp b/content/media/MediaStreamGraph.cpp index 7bf63333b1b3..9de3e3e321bb 100644 --- a/content/media/MediaStreamGraph.cpp +++ b/content/media/MediaStreamGraph.cpp @@ -1906,9 +1906,6 @@ MediaInputPort::Destroy() { Run(); } - // This does not need to be strongly referenced; the graph is holding - // a strong reference to the port, which we will remove. This will be the - // last message for the port. MediaInputPort* mPort; }; GraphImpl()->AppendMessage(new Message(this)); @@ -1950,6 +1947,10 @@ ProcessedMediaStream::AllocateInputPort(MediaStream* aStream, uint32_t aFlags, // The graph holds its reference implicitly mPort.forget(); } + virtual void RunDuringShutdown() + { + Run(); + } nsRefPtr mPort; }; nsRefPtr port = new MediaInputPort(aStream, this, aFlags, diff --git a/content/media/webaudio/test/Makefile.in b/content/media/webaudio/test/Makefile.in index 19acdda4b40c..79369349920d 100644 --- a/content/media/webaudio/test/Makefile.in +++ b/content/media/webaudio/test/Makefile.in @@ -23,6 +23,7 @@ MOCHITEST_FILES := \ test_bug867104.html \ test_bug867174.html \ test_bug867203.html \ + test_bug875402.html \ test_analyserNode.html \ test_AudioBuffer.html \ test_AudioContext.html \ diff --git a/content/media/webaudio/test/test_bug875402.html b/content/media/webaudio/test/test_bug875402.html new file mode 100644 index 000000000000..da1fe091ec80 --- /dev/null +++ b/content/media/webaudio/test/test_bug875402.html @@ -0,0 +1,46 @@ + + + + Crashtest for bug 875402 + + + + +
+
+
+ +