Bug 1158307 - Add Shutdown checks r=cpearce

This commit is contained in:
Sotaro Ikeda 2015-04-29 07:55:21 -07:00
parent 0b01a9eedb
commit cb2fec0936

View File

@ -61,6 +61,11 @@ MediaOmxCommonDecoder::FirstFrameLoaded(nsAutoPtr<MediaInfo> aInfo,
MediaDecoderEventVisibility aEventVisibility)
{
MOZ_ASSERT(NS_IsMainThread());
if (mShuttingDown) {
return;
}
MediaDecoder::FirstFrameLoaded(aInfo, aEventVisibility);
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
@ -98,6 +103,11 @@ MediaOmxCommonDecoder::PauseStateMachine()
MOZ_ASSERT(NS_IsMainThread());
GetReentrantMonitor().AssertCurrentThreadIn();
DECODER_LOG(PR_LOG_DEBUG, ("%s", __PRETTY_FUNCTION__));
if (mShuttingDown) {
return;
}
if (!GetStateMachine()) {
return;
}
@ -118,6 +128,10 @@ MediaOmxCommonDecoder::ResumeStateMachine()
DECODER_LOG(PR_LOG_DEBUG, ("%s current time %f", __PRETTY_FUNCTION__,
mCurrentTime));
if (mShuttingDown) {
return;
}
if (!GetStateMachine()) {
return;
}