Bug 1418917. P2 - NotifyClientSuspended() should check mClosed.
MozReview-Commit-ID: 9mBPwfyfWCV
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -2251,20 +2251,20 @@ MediaCacheStream::NotifyDataEnded(uint32
void
MediaCacheStream::NotifyClientSuspended(bool aSuspended)
{
MOZ_ASSERT(NS_IsMainThread());
RefPtr<ChannelMediaResource> client = mClient;
nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction(
"MediaCacheStream::NotifyClientSuspended", [client, this, aSuspended]() {
- if (mClientSuspended != aSuspended) {
+ ReentrantMonitorAutoEnter mon(mMediaCache->GetReentrantMonitor());
+ if (!mClosed && mClientSuspended != aSuspended) {
mClientSuspended = aSuspended;
// mClientSuspended changes the decision of reading streams.
- ReentrantMonitorAutoEnter mon(mMediaCache->GetReentrantMonitor());
mMediaCache->QueueUpdate();
}
});
OwnerThread()->Dispatch(r.forget());
}
MediaCacheStream::~MediaCacheStream()
{