[webkit-dev] Must a plugin still retain a reference to a scriptable object?

Aaron Drew aarond10 at gmail.com
Fri May 14 11:01:45 PDT 2010


Hi,

I just discovered my plugin was leaking memory on Mac Safari today (531
running under XCode) and did some digging. I'm not much of an expert at
NPAPI but to me it looks like a reference count issue related to an
NPP_GetValue() call for a NPPVpluginScriptableNPObject.

The plugin code I'm using retains a reference as per this Apple document:


http://developer.apple.com/mac/library/documentation/InternetWeb/Conceptual/WebKit_PluginProgTopic/WebKit_PluginProgTopic.pdf
(page
19)

When I remove the retain, my memory leak goes away and I seem to get no ill
effects.

The note says versions from 420 onwards should retain the returned object.
Is this still the case?

Regards,
Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20100515/29502c30/attachment.html>


More information about the webkit-dev mailing list