<?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 - LEAVE and TRAP, part II: NewL and NewLC - Comments</title>
 <link>http://www.newlc.com/en/LEAVE-and-TRAP-part-II-NewL-and.html</link>
 <description>Comments for &quot;LEAVE and TRAP, part II: NewL and NewLC&quot;</description>
 <language>en</language>
<item>
 <title>Re: LEAVE and TRAP, part II: NewL and NewLC</title>
 <link>http://www.newlc.com/en/LEAVE-and-TRAP-part-II-NewL-and.html#comment-41726</link>
 <description>&lt;p&gt;If a function leaves at constructL() , You are thinking that it does not have any reference. But we are pushing the &quot; self &quot; into the CleanupStack before calling the constructL therefore it can be popped and destroyed.   &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt; &lt;/p&gt;</description>
 <pubDate>Sat, 22 Sep 2007 14:07:09 +0200</pubDate>
 <dc:creator>murthy</dc:creator>
 <guid isPermaLink="false">comment 41726 at http://www.newlc.com</guid>
</item>
<item>
 <title>LEAVE and TRAP, part II: NewL and NewLC</title>
 <link>http://www.newlc.com/en/LEAVE-and-TRAP-part-II-NewL-and.html#comment-1628</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;Better late than never. This is wonderful explanation for such a confusing and fundamental topic on Symbian. Great work.&lt;/div&gt;</description>
 <pubDate>Tue, 13 Mar 2007 07:44:03 +0100</pubDate>
 <dc:creator>Anonymous</dc:creator>
 <guid isPermaLink="false">comment 1628 at http://www.newlc.com</guid>
</item>
<item>
 <title>LEAVE and TRAP, part II: NewL and NewLC</title>
 <link>http://www.newlc.com/en/LEAVE-and-TRAP-part-II-NewL-and.html#comment-1627</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;&lt;p class=&quot;spip&quot;&gt;Wht will happen if function leaves at ConstructL(),.......and before return self of NewLC().&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;CleanUpStackPopAndDestroy(),............would be poping and destroying a NULL object.Can anybody explain??&lt;/p&gt;&lt;/div&gt;</description>
 <pubDate>Fri, 27 Oct 2006 07:44:15 +0200</pubDate>
 <dc:creator>Anonymous</dc:creator>
 <guid isPermaLink="false">comment 1627 at http://www.newlc.com</guid>
</item>
<item>
 <title>LEAVE and TRAP, part II: NewL and NewLC</title>
 <link>http://www.newlc.com/en/LEAVE-and-TRAP-part-II-NewL-and.html#comment-1626</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;&lt;p class=&quot;spip&quot;&gt;EXPORT_C CUser* CUser::NewLC( MUserStateObserver* aObserver )
&lt;i class=&quot;spip&quot;&gt;
   CUser* self = new (ELeave) CUser( aObserver );
   CleanupStack::PushL(self);
   self-&gt;ConstructL();
   return self;
&lt;/i&gt;&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;&lt;strong class=&quot;spip&quot;&gt;Suppose in my function i have&lt;/strong&gt;:&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;CUser *ptrMyUser = CUSer::NewLC(/*SomeObserver*/);
MyUser-&gt;SomeFunction();
CleanUpStack::PopAndDestroy(ptrMyUser);&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;what would happen if ConstructL( )leaves?? &quot;return self&quot; the next statement would not execute and &quot;ptrMyUser&quot; object
would be NULL.PopAndDestroy(ptrMyUser)would pop and destroy an object pointed by ptrMyUser which is NUll pointer.&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;We still have a pointer pushed to cleanupstack, but which has not been poped and destroyed.So in such scenario are we not leaving a pointer on clean up stack???&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;Please clarify.&lt;/p&gt;&lt;/div&gt;</description>
 <pubDate>Tue, 24 Oct 2006 15:44:01 +0200</pubDate>
 <dc:creator>krishnaramram</dc:creator>
 <guid isPermaLink="false">comment 1626 at http://www.newlc.com</guid>
</item>
<item>
 <title>LEAVE and TRAP, part II: NewL and NewLC</title>
 <link>http://www.newlc.com/en/LEAVE-and-TRAP-part-II-NewL-and.html</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;Some additional definitions about object contruction (class instantiation) on Symbian, the object creation method formerly named &quot;two-phase construction&quot;, and the NewL and NewLC static methods...&lt;/div&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/en/LEAVE-and-TRAP-part-II-NewL-and.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/en/LEAVE-and-TRAP-part-II-NewL-and.html#comments</comments>
 <category domain="http://www.newlc.com/en/taxonomy/term/1">Basics</category>
 <pubDate>Fri, 23 Jul 2004 09:49:05 +0200</pubDate>
 <dc:creator>rosfranborges</dc:creator>
 <guid isPermaLink="false">370 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
