Bug 1049501: Don't let the GMPThread event loop recurse while handling IPDL shutdowns r=bsmedberg

This commit is contained in:
Randell Jesup 2014-08-14 13:50:25 -04:00
Родитель 5d8df0d985
Коммит 15385e72c4
1 изменённых файлов: 9 добавлений и 1 удалений

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

@ -72,7 +72,9 @@ GMPVideoEncoderParent::GMPVideoEncoderParent(GMPParent *aPlugin)
GMPVideoEncoderParent::~GMPVideoEncoderParent()
{
mEncodedThread->Shutdown();
if (mEncodedThread) {
mEncodedThread->Shutdown();
}
}
GMPVideoHostImpl&
@ -249,6 +251,12 @@ GMPVideoEncoderParent::ActorDestroy(ActorDestroyReason aWhy)
mCallback->Terminated();
mCallback = nullptr;
}
// Must be shut down before VideoEncoderDestroyed(), since this can recurse
// the GMPThread event loop. See bug 1049501
if (mEncodedThread) {
mEncodedThread->Shutdown();
mEncodedThread = nullptr;
}
if (mPlugin) {
// Ignore any return code. It is OK for this to fail without killing the process.
mPlugin->VideoEncoderDestroyed(this);