Symbian3/SDK/Source/GUID-E455ABFF-3EFF-5396-A52A-A33CDB2EB41A.dita
changeset 0 89d6a7a84779
equal deleted inserted replaced
-1:000000000000 0:89d6a7a84779
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-E455ABFF-3EFF-5396-A52A-A33CDB2EB41A" xml:lang="en"><title>Cleanup
       
    13 utilities</title><shortdesc>The Cleanup utility functions support four types of clean up operation.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>The cleanup utility functions offer easy ways of constructing a <codeph>TCleanUpItem</codeph> and
       
    15 pushing it onto the cleanup stack. They support four types of clean up operation:</p>
       
    16 <ul>
       
    17 <li id="GUID-8E3A2FEC-B065-5059-800F-5227516A961A"><p>where the object is
       
    18 deleted: <codeph>template &lt;class T&gt; void CleanupDeletePushL(T*)</codeph> </p> </li>
       
    19 <li id="GUID-94C6925C-E68C-5F39-9CD3-6C2D4BC6CFEE"><p>where the object's <codeph>Close()</codeph> member
       
    20 function is called: <codeph>template &lt;class T&gt; void CleanupClosePushL(T&amp;)</codeph> </p> </li>
       
    21 <li id="GUID-7B17DA1E-9D7F-572A-9CF5-B63C8784970A"><p>where the object's <codeph>Release()</codeph> member
       
    22 function is called: <codeph>template &lt;class T&gt; void CleanupReleasePushL(T&amp;)</codeph> </p> </li>
       
    23 <li id="GUID-0F488FA6-FE3F-5305-8189-5206A18C53FA"><p>where an array of objects
       
    24 is deleted: <codeph>template &lt;class T&gt; void CleanupArrayDeletePushL(T*)</codeph> </p> </li>
       
    25 </ul>
       
    26 <p>The functions have the supporting templated classes:</p>
       
    27 <ul>
       
    28 <li id="GUID-CBEC6897-F471-5C35-8BC6-15742C3FF7DB"><p><codeph>CleanupDelete&lt;class
       
    29 T&gt;</codeph> </p> </li>
       
    30 <li id="GUID-00C1B92A-AB53-58E2-B89D-94292B2E00C0"><p><codeph>CleanupClose&lt;class
       
    31 T&gt;</codeph> </p> </li>
       
    32 <li id="GUID-905CC005-9A20-5276-A546-1FF0B487A819"><p><codeph>CleanupRelease&lt;class
       
    33 T&gt;</codeph> </p> </li>
       
    34 <li id="GUID-4EDD2083-BB2B-52F5-9E60-E0A608FF2885"><p><codeph>CleanupArrayDelete&lt;class
       
    35 T&gt;</codeph> </p> </li>
       
    36 </ul>
       
    37 <p>The way in which these work is best illustrated graphically by taking <codeph>CleanupClosePushL()</codeph> as
       
    38 an example. See the diagram below.</p>
       
    39 <fig id="GUID-8A0CEC7B-BFEB-52BF-B205-9EB0DE094C8D">
       
    40 <title>Effect of CleanupClosePushL and subsequent pop and destroy</title>
       
    41 <image href="GUID-018A685B-5C9D-5C7C-8615-D413ABBF7CFB_d0e217409_href.png" placement="inline"/>
       
    42 </fig>
       
    43 </conbody></concept>