Symbian3/SDK/Source/GUID-E455ABFF-3EFF-5396-A52A-A33CDB2EB41A.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 12:39:03 +0100
changeset 8 ae94777fff8f
parent 7 51a74ef9ed63
child 13 48780e181b38
permissions -rw-r--r--
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.

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