<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - Cleanup support for ResetAndDestroy() - Comments</title>
 <link>http://www.newlc.com/en/Cleanup-support-for.html</link>
 <description>Comments for &quot;Cleanup support for ResetAndDestroy()&quot;</description>
 <language>en</language>
<item>
 <title>&gt; Cleanup support for ResetAndDestroy()</title>
 <link>http://www.newlc.com/en/Cleanup-support-for.html#comment-1908</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;Here is an &lt;a href=&quot;http://symbianexample.com/node/64&quot; class=&quot;spip_out&quot;&gt;example of a built-in CleanupResetAndDestroyPushL&lt;/a&gt;&lt;/div&gt;</description>
 <pubDate>Sat, 17 Jun 2006 15:28:28 +0200</pubDate>
 <dc:creator>Artem</dc:creator>
 <guid isPermaLink="false">comment 1908 at http://www.newlc.com</guid>
</item>
<item>
 <title>&gt; Cleanup support for ResetAndDestroy()</title>
 <link>http://www.newlc.com/en/Cleanup-support-for.html#comment-1907</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;&lt;p class=&quot;spip&quot;&gt;Actually there is an entire implementation of this already provided in Symbian 7.0s in the mmf\common\mmfcontrollerpluginresolver.h class&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;No I don&#039;t kno why it was put there and I know the some of the guys in Symbian that wrote the MMF module!&lt;/p&gt;&lt;/div&gt;</description>
 <pubDate>Tue, 04 Oct 2005 11:33:18 +0200</pubDate>
 <dc:creator>Anonymous</dc:creator>
 <guid isPermaLink="false">comment 1907 at http://www.newlc.com</guid>
</item>
<item>
 <title>&gt; Cleanup support for ResetAndDestroy()</title>
 <link>http://www.newlc.com/en/Cleanup-support-for.html#comment-1906</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;That&#039;s a great solution, I like it! To support this feature, you either have to use cleanup items or TRAP the first leave. And I agree that TRAPping is much more expensive and, on the other hand, using TCleanupItem is much nicer. Cool.&lt;/div&gt;</description>
 <pubDate>Wed, 27 Oct 2004 21:02:56 +0200</pubDate>
 <dc:creator>tOtE</dc:creator>
 <guid isPermaLink="false">comment 1906 at http://www.newlc.com</guid>
</item>
<item>
 <title>&gt; Cleanup support for ResetAndDestroy()</title>
 <link>http://www.newlc.com/en/Cleanup-support-for.html#comment-1905</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;&lt;p class=&quot;spip&quot;&gt;There is a subtle flaw in this, in that if the first line of the CleanupResetAndDestroyPushL method leaves then the array does not get cleaned up.&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;All the standard clean up stack functions guarantee that they take ownership of the object passed in. To do this they make sure that there is always at least one spare slot on the clean up stack. If a call to CleanupStack::PushL or CleanupClosePushL (or others) uses the last available slot, the stack will allocate more memory, which could cause a leave, which is why all the xxxPushL functions can leave. If a leave occurs, the object that was pushed on is destroyed along with the rest of the clean up items on the stack. Doing any kind of leaving operation in a CleanupResetAndDestroyPushL style function before the item is on the clean up stack is unsafe.&lt;/p&gt;&lt;/div&gt;</description>
 <pubDate>Thu, 21 Oct 2004 11:46:54 +0200</pubDate>
 <dc:creator>Anonymous</dc:creator>
 <guid isPermaLink="false">comment 1905 at http://www.newlc.com</guid>
</item>
<item>
 <title>&gt; Cleanup support for ResetAndDestroy()</title>
 <link>http://www.newlc.com/en/Cleanup-support-for.html#comment-1904</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;&lt;p class=&quot;spip&quot;&gt;Actually there is Symbian API support for this kind of behaviour.&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;Implement a cleanup method taking a TAny* parameter like 
void CleanupArray(TAny* aObj); and inside that method cast the aObj to correct array type and then call ResetAndDestroy().&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;To use the cleanup method push a TCleanupItem to the cleanup stack:
RPointerArray&amp;lt;CMyType&amp;gt;* list = new RPointerArray&amp;lt;CMyType&amp;gt;( 1 );
CleanupStack::PushL(TCleanupItem(CleanupArray, list));
//...
CleanupStack::PopAndDestroy();&lt;/p&gt;&lt;/div&gt;</description>
 <pubDate>Tue, 19 Oct 2004 09:24:47 +0200</pubDate>
 <dc:creator>Anonymous</dc:creator>
 <guid isPermaLink="false">comment 1904 at http://www.newlc.com</guid>
</item>
<item>
 <title>Cleanup support for ResetAndDestroy()</title>
 <link>http://www.newlc.com/en/Cleanup-support-for.html</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;Need to perform ResetAndDestroy() for a list upon leave/a call to CleanupStack::PopAndDestroy()? Here&#039;s how.&lt;/div&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/en/Cleanup-support-for.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/en/Cleanup-support-for.html#comments</comments>
 <category domain="http://www.newlc.com/en/taxonomy/term/18">Tips</category>
 <pubDate>Mon, 18 Oct 2004 21:54:35 +0200</pubDate>
 <dc:creator>mdahlbom</dc:creator>
 <guid isPermaLink="false">444 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
