Bug 771202 - Don't double-call OnWrapperDestroyed. r=bsmedberg

Calling OnWrapperDestroyed at this point in OnDestroy doesn't make sense, because the JS objects have a finalize hook that also calls OnWrapperDestroyed regardless of whether or not they still have a pointer stashed in their private. So when we do this, we get a bunch of assertions about unmatched calls to OnWrapperDestroyed.

AFAICT the only reason this worked before is that this code never ran: I put a MOZ_ASSERT just before call to OnWrappedDestroyed in OnDestroy, and it never fired during the dom/plugins mochitests.
This commit is contained in:
Bobby Holley 2012-07-13 10:56:38 +02:00
parent ba801827f7
commit 50c6d52c5a

View File

@ -1782,7 +1782,7 @@ nsNPObjWrapper::OnDestroy(NPObject *npobj)
// Remove the npobj from the hash now that it went away.
PL_DHashTableRawRemove(&sNPObjWrappers, entry);
OnWrapperDestroyed();
// The finalize hook will call OnWrapperDestroyed().
}
}