<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Memory management in NPAPI</title>
	<atom:link href="http://colonelpanic.net/2009/12/memory-management-in-npapi/feed/" rel="self" type="application/rss+xml" />
	<link>http://colonelpanic.net/2009/12/memory-management-in-npapi/</link>
	<description>Dumping our corps so you don&#039;t have to</description>
	<lastBuildDate>Mon, 06 Feb 2012 03:59:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: NPAPI Plugin (Must read) &#124; Source Code Auditing</title>
		<link>http://colonelpanic.net/2009/12/memory-management-in-npapi/comment-page-1/#comment-610</link>
		<dc:creator>NPAPI Plugin (Must read) &#124; Source Code Auditing</dc:creator>
		<pubDate>Thu, 22 Dec 2011 14:12:29 +0000</pubDate>
		<guid isPermaLink="false">http://colonelpanic.net/?p=111#comment-610</guid>
		<description>[...] http://colonelpanic.net/2009/12/memory-management-in-npapi/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://colonelpanic.net/2009/12/memory-management-in-npapi/" rel="nofollow">http://colonelpanic.net/2009/12/memory-management-in-npapi/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: taxilian</title>
		<link>http://colonelpanic.net/2009/12/memory-management-in-npapi/comment-page-1/#comment-393</link>
		<dc:creator>taxilian</dc:creator>
		<pubDate>Wed, 08 Sep 2010 04:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://colonelpanic.net/?p=111#comment-393</guid>
		<description>In the situation you describe, the browser has retained ownership of the parameter and may release it at any time.  If you want to hold onto a reference beyond the scope of that call, you need to call NPN_RetainObject on it, and then NPN_ReleaseObject when you&#039;re done.  The only time that the object must be released that you didn&#039;t specifically retain it is if it was returned to you when a function call ended.

The reason for this, of course, is that if it is returned, the browser has no further code path after you get the reference in which it could release, so it just passes its reference to you.</description>
		<content:encoded><![CDATA[<p>In the situation you describe, the browser has retained ownership of the parameter and may release it at any time.  If you want to hold onto a reference beyond the scope of that call, you need to call NPN_RetainObject on it, and then NPN_ReleaseObject when you&#8217;re done.  The only time that the object must be released that you didn&#8217;t specifically retain it is if it was returned to you when a function call ended.</p>
<p>The reason for this, of course, is that if it is returned, the browser has no further code path after you get the reference in which it could release, so it just passes its reference to you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken Smith</title>
		<link>http://colonelpanic.net/2009/12/memory-management-in-npapi/comment-page-1/#comment-391</link>
		<dc:creator>Ken Smith</dc:creator>
		<pubDate>Tue, 07 Sep 2010 20:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://colonelpanic.net/?p=111#comment-391</guid>
		<description>A question or clarification.  The rule of thumb, as you say, is &quot;If the browser gives it to you as a return value, release it when you&#039;re done.&quot;  But what if the browser gives it to you not as a return value, but as, say, a parameter in a method?  For instance, if I have a ScriptablePluginObject::Invoke() method, and the browser passes me an NPObject event handler function in the *args parameter, and I store that for later reference, do I need to call NPN_ReleaseObject() if that event handler is cleared?  I&#039;m assuming that I don&#039;t, since it&#039;s not passed as a return value, but I&#039;d be curious as to why.  (Still trying to wrap my head  around NPAPI and npruntime, obviously.)</description>
		<content:encoded><![CDATA[<p>A question or clarification.  The rule of thumb, as you say, is &#8220;If the browser gives it to you as a return value, release it when you&#8217;re done.&#8221;  But what if the browser gives it to you not as a return value, but as, say, a parameter in a method?  For instance, if I have a ScriptablePluginObject::Invoke() method, and the browser passes me an NPObject event handler function in the *args parameter, and I store that for later reference, do I need to call NPN_ReleaseObject() if that event handler is cleared?  I&#8217;m assuming that I don&#8217;t, since it&#8217;s not passed as a return value, but I&#8217;d be curious as to why.  (Still trying to wrap my head  around NPAPI and npruntime, obviously.)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

