From 5c88bf3ea3127c4620d7709d2bc2a818704a0e2b Mon Sep 17 00:00:00 2001 From: Matthew Gregan Date: Mon, 8 Sep 2014 12:59:36 +1200 Subject: [PATCH] Bug 1064118 - Drop MediaSourceReader sub-reader refs in a safer order. r=cajbir --- content/media/mediasource/MediaSourceReader.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/content/media/mediasource/MediaSourceReader.cpp b/content/media/mediasource/MediaSourceReader.cpp index 2fd0badaa5ac..253d80dcfb07 100644 --- a/content/media/mediasource/MediaSourceReader.cpp +++ b/content/media/mediasource/MediaSourceReader.cpp @@ -209,28 +209,28 @@ void MediaSourceReader::Shutdown() { MediaDecoderReader::Shutdown(); - for (uint32_t i = 0; i < mTrackBuffers.Length(); ++i) { - mTrackBuffers[i]->Shutdown(); - } - mTrackBuffers.Clear(); mAudioTrack = nullptr; mAudioReader = nullptr; mVideoTrack = nullptr; mVideoReader = nullptr; + for (uint32_t i = 0; i < mTrackBuffers.Length(); ++i) { + mTrackBuffers[i]->Shutdown(); + } + mTrackBuffers.Clear(); } void MediaSourceReader::BreakCycles() { MediaDecoderReader::BreakCycles(); - for (uint32_t i = 0; i < mTrackBuffers.Length(); ++i) { - mTrackBuffers[i]->BreakCycles(); - } - mTrackBuffers.Clear(); mAudioTrack = nullptr; mAudioReader = nullptr; mVideoTrack = nullptr; mVideoReader = nullptr; + for (uint32_t i = 0; i < mTrackBuffers.Length(); ++i) { + mTrackBuffers[i]->BreakCycles(); + } + mTrackBuffers.Clear(); } bool