Bug 540868 part 3: when deallocating NPObjects in leakcount builds, let the leak monitor know that we cleaned them up correctly, r=bent
--- a/dom/plugins/PluginModuleChild.cpp
+++ b/dom/plugins/PluginModuleChild.cpp
@@ -1583,16 +1583,26 @@ PluginModuleChild::DeallocNPObject(NPObj
PLDHashOperator
PluginModuleChild::DeallocForInstance(NPObjectData* d, void* userArg)
{
if (d->instance == static_cast<PluginInstanceChild*>(userArg)) {
NPObject* o = d->GetKey();
if (o->_class && o->_class->invalidate)
o->_class->invalidate(o);
+#ifdef NS_BUILD_REFCNT_LOGGING
+ {
+ int32_t refCnt = o->referenceCount;
+ while (refCnt) {
+ --refCnt;
+ NS_LOG_RELEASE(o, refCnt, "NPObject");
+ }
+ }
+#endif
+
DeallocNPObject(o);
if (d->actor)
d->actor->NPObjectDestroyed();
return PL_DHASH_REMOVE;
}