Bug 1163239 - Check mGMPThread on shutdown. r=cpearce

--HG--
extra : rebase_source : 47c0458e8bc8bb14ca3245f33a416209b4f64ef4
This commit is contained in:
Ethan Hugg 2015-05-11 10:48:46 -07:00
Родитель 058b46c6b4
Коммит c597bbc86a
1 изменённых файлов: 15 добавлений и 5 удалений

Просмотреть файл

@ -365,11 +365,21 @@ void
GMPParent::ChildTerminated()
{
nsRefPtr<GMPParent> self(this);
GMPThread()->Dispatch(NS_NewRunnableMethodWithArg<nsRefPtr<GMPParent>>(
mService,
&GeckoMediaPluginServiceParent::PluginTerminated,
self),
NS_DISPATCH_NORMAL);
nsIThread* gmpThread = GMPThread();
if (!gmpThread) {
// Bug 1163239 - this can happen on shutdown.
// PluginTerminated removes the GMP from the GMPService.
// On shutdown we can have this case where it is already been
// removed so there is no harm in not trying to remove it again.
LOGD("%s::%s: GMPThread() returned nullptr.", __CLASS__, __FUNCTION__);
} else {
gmpThread->Dispatch(NS_NewRunnableMethodWithArg<nsRefPtr<GMPParent>>(
mService,
&GeckoMediaPluginServiceParent::PluginTerminated,
self),
NS_DISPATCH_NORMAL);
}
}
void