Bug 1430586 - Make sure the NPObjectData map still exists before use. r=jimm

The shutdown path has a way to free the sObjectMap before all plugin references to it have been executed.  It does this by scheduling a DeferNPObjectReleaseRunnable, then shutting down the plugin with PluginInstanceChild::Destroy.  This patch keeps the runnable from failing in that case.
This commit is contained in:
David Parks
2018-01-23 12:56:06 -08:00
parent 7bdf4d91f4
commit d934bd37cc
2 changed files with 6 additions and 1 deletions

View File

@@ -1273,6 +1273,11 @@ PluginScriptableObjectChild::UnregisterObject(NPObject* aObject)
PluginScriptableObjectChild::GetInstanceForNPObject(NPObject* aObject)
{
AssertPluginThread();
if (!sObjectMap) {
// All PluginInstanceChilds have been destroyed
return nullptr;
}
NPObjectData* d = sObjectMap->GetEntry(aObject);
if (!d) {
return nullptr;