Bug 1171453: Make ParentNPObjects aware of AsyncNPObject wrappers; r=jimm

This commit is contained in:
Aaron Klotz
2015-06-10 12:20:56 -06:00
parent e040bde211
commit 432078c711
4 changed files with 27 additions and 3 deletions

View File

@@ -166,6 +166,15 @@ PluginScriptableObjectParent::ScriptableDeallocate(NPObject* aObject)
}
ParentNPObject* object = reinterpret_cast<ParentNPObject*>(aObject);
if (object->asyncWrapperCount > 0) {
// In this case we should just drop the refcount to the asyncWrapperCount
// instead of deallocating because there are still some async wrappers
// out there that are referencing this object.
object->referenceCount = object->asyncWrapperCount;
return;
}
PluginScriptableObjectParent* actor = object->parent;
if (actor) {
NS_ASSERTION(actor->Type() == Proxy, "Bad type!");