<?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: SPLimitedWebPartManager Memory Leak?</title>
	<atom:link href="http://www.ofonesandzeros.com/2007/06/05/splimitedwebpartmanager-memory-leak/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ofonesandzeros.com/2007/06/05/splimitedwebpartmanager-memory-leak/</link>
	<description>a discussion of software and technology hosted by bryan napier</description>
	<lastBuildDate>Wed, 30 Jun 2010 11:06:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: ArianaSype</title>
		<link>http://www.ofonesandzeros.com/2007/06/05/splimitedwebpartmanager-memory-leak/comment-page-1/#comment-22</link>
		<dc:creator>ArianaSype</dc:creator>
		<pubDate>Wed, 13 May 2009 12:18:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ofonesandzeros.com/2007/06/05/splimitedwebpartmanager-memory-leak/#comment-22</guid>
		<description>Wow! Thank you very much! I always wanted to write in my site something like that</description>
		<content:encoded><![CDATA[<p>Wow! Thank you very much! I always wanted to write in my site something like that</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JessicaRich</title>
		<link>http://www.ofonesandzeros.com/2007/06/05/splimitedwebpartmanager-memory-leak/comment-page-1/#comment-19</link>
		<dc:creator>JessicaRich</dc:creator>
		<pubDate>Sun, 10 May 2009 17:20:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ofonesandzeros.com/2007/06/05/splimitedwebpartmanager-memory-leak/#comment-19</guid>
		<description>Thanks for posting, definitely going to subscribe! See you on my reader.</description>
		<content:encoded><![CDATA[<p>Thanks for posting, definitely going to subscribe! See you on my reader.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Incanna</title>
		<link>http://www.ofonesandzeros.com/2007/06/05/splimitedwebpartmanager-memory-leak/comment-page-1/#comment-16</link>
		<dc:creator>Incanna</dc:creator>
		<pubDate>Fri, 08 May 2009 05:37:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ofonesandzeros.com/2007/06/05/splimitedwebpartmanager-memory-leak/#comment-16</guid>
		<description>ehh. interesting..</description>
		<content:encoded><![CDATA[<p>ehh. interesting..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.ofonesandzeros.com/2007/06/05/splimitedwebpartmanager-memory-leak/comment-page-1/#comment-5</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Wed, 24 Oct 2007 12:38:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ofonesandzeros.com/2007/06/05/splimitedwebpartmanager-memory-leak/#comment-5</guid>
		<description>The difference is that the web part manager is not using your w instance, it creates its own instance on the following line:

SPWeb web = this.Site.OpenWeb();

In your example you actually have 2 instances of SPWeb, you have your instance &quot;w&quot;, and then there is an instance encapsulated in the web part manager &quot;web&quot;.  The web part manager should dispose of the &quot;web&quot; instance, not your &quot;w&quot; instance.</description>
		<content:encoded><![CDATA[<p>The difference is that the web part manager is not using your w instance, it creates its own instance on the following line:</p>
<p>SPWeb web = this.Site.OpenWeb();</p>
<p>In your example you actually have 2 instances of SPWeb, you have your instance &#8220;w&#8221;, and then there is an instance encapsulated in the web part manager &#8220;web&#8221;.  The web part manager should dispose of the &#8220;web&#8221; instance, not your &#8220;w&#8221; instance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shai</title>
		<link>http://www.ofonesandzeros.com/2007/06/05/splimitedwebpartmanager-memory-leak/comment-page-1/#comment-4</link>
		<dc:creator>Shai</dc:creator>
		<pubDate>Wed, 24 Oct 2007 11:07:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ofonesandzeros.com/2007/06/05/splimitedwebpartmanager-memory-leak/#comment-4</guid>
		<description>Hi,
I fail to understand why you feel that disposing of the web part manager should also dispose its owner web?

for instance, if you have code like this:
spweb w = .....
SPLimitedWebPartManager mgr = w.OpenFile(&quot;...&quot;).GetLimitedWebPartManager(...);
mgr.AddWebPart(...);
mgr.Dispose();

w.Title += &quot; Done!&quot;;
w.Update();
w.Dispose();

See, I continue to work on the web object after disposing of the limited web part manager... It would be a bug if my w.TItle update will fail... no?</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I fail to understand why you feel that disposing of the web part manager should also dispose its owner web?</p>
<p>for instance, if you have code like this:<br />
spweb w = &#8230;..<br />
SPLimitedWebPartManager mgr = w.OpenFile(&#8220;&#8230;&#8221;).GetLimitedWebPartManager(&#8230;);<br />
mgr.AddWebPart(&#8230;);<br />
mgr.Dispose();</p>
<p>w.Title += &#8221; Done!&#8221;;<br />
w.Update();<br />
w.Dispose();</p>
<p>See, I continue to work on the web object after disposing of the limited web part manager&#8230; It would be a bug if my w.TItle update will fail&#8230; no?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter {faa780ce-0f0a-4c28-81d2-3667b71287fd}</title>
		<link>http://www.ofonesandzeros.com/2007/06/05/splimitedwebpartmanager-memory-leak/comment-page-1/#comment-3</link>
		<dc:creator>Peter {faa780ce-0f0a-4c28-81d2-3667b71287fd}</dc:creator>
		<pubDate>Fri, 28 Sep 2007 19:15:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ofonesandzeros.com/2007/06/05/splimitedwebpartmanager-memory-leak/#comment-3</guid>
		<description>Yes, this is exactly what I saw. It didn&#039;t surprise me at all when I got my &quot;outofmemoryexception&quot;; I already had a healthy fear of SharePoint. :)</description>
		<content:encoded><![CDATA[<p>Yes, this is exactly what I saw. It didn&#8217;t surprise me at all when I got my &#8220;outofmemoryexception&#8221;; I already had a healthy fear of SharePoint. <img src='http://www.ofonesandzeros.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Fant</title>
		<link>http://www.ofonesandzeros.com/2007/06/05/splimitedwebpartmanager-memory-leak/comment-page-1/#comment-2</link>
		<dc:creator>Jason Fant</dc:creator>
		<pubDate>Fri, 08 Jun 2007 05:40:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ofonesandzeros.com/2007/06/05/splimitedwebpartmanager-memory-leak/#comment-2</guid>
		<description>Interestingly enough, Tom Sallese and I attended a session at TechEd today covering the WSS object model. One of the things that the speaker covered as a little known &quot;gotcha&quot; was exactly what you are talking about. It appears that we are going to have to be really careful when playing with the SharePoint&#039;s object model. Good looking out B.</description>
		<content:encoded><![CDATA[<p>Interestingly enough, Tom Sallese and I attended a session at TechEd today covering the WSS object model. One of the things that the speaker covered as a little known &#8220;gotcha&#8221; was exactly what you are talking about. It appears that we are going to have to be really careful when playing with the SharePoint&#8217;s object model. Good looking out B.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
