Bug 1394724. P1 - assert the channel is already closed in ~ChannelMediaResource().
MozReview-Commit-ID: 4lJNEEBsv4r
--- a/dom/media/MediaResource.cpp
+++ b/dom/media/MediaResource.cpp
@@ -104,20 +104,18 @@ ChannelMediaResource::ChannelMediaResour
, mChannelStatistics(aStatistics)
, mIgnoreResume(false)
, mSuspendAgent(mChannel)
{
}
ChannelMediaResource::~ChannelMediaResource()
{
- if (mListener) {
- // Kill its reference to us since we're going away
- mListener->Revoke();
- }
+ MOZ_ASSERT(!mChannel);
+ MOZ_ASSERT(!mListener);
}
// ChannelMediaResource::Listener just observes the channel and
// forwards notifications to the ChannelMediaResource. We use multiple
// listener objects so that when we open a new stream for a seek we can
// disconnect the old listener from the ChannelMediaResource and hook up
// a new listener, so notifications from the old channel are discarded
// and don't confuse us.