CleanupDeletePushL() pushes a TCleanupItem onto the cleanup stack ready for CleanupStack::PopAndDestroy() to delete.
The CleanupDeletePushL() templated function constructs and pushes a TCleanupItem onto the cleanup stack. When CleanupStack::PopAndDestroy() is called, the object encapsulated by the TCleanupItem is deleted.
... CTestOne* one = new (ELeave) CTestOne; CleanupDeletePushL(one); one->SetTextL(KTxtHelloWorld); CleanupStack::PopAndDestroy(); ...
The TCleanupItem object encapsulates a pointer to the CTestOne object; the cleanup operation is the static function Delete() of the templated class CleanupDelete<class T> . This is implemented by simply deleting CTestOne .
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.