diff -r 000000000000 -r 89d6a7a84779 Symbian3/SDK/Source/GUID-76D1438E-445E-5864-BA9D-27BC61D72C1B.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-76D1438E-445E-5864-BA9D-27BC61D72C1B.dita Thu Jan 21 18:18:20 2010 +0000 @@ -0,0 +1,37 @@ + + + + + +How +to use CleanupClosePushL()The CleanupClosePushL() templated function constructs and pushes +a TCleanupItem onto the cleanup stack. +

The CleanupClosePushL() templated function constructs +and pushes a TCleanupItem onto the cleanup stack. When CleanupStack::PopAndDestroy() is +called, the Close() member function of the object encapsulated +by the TCleanupItem is called.

+... +RTestTwo two; +CleanupClosePushL(two); +... +CleanupStack::PopAndDestroy(); +... +

The TCleanupItem object encapsulates a reference to the RTestTwo object; +the cleanup operation is the static function Close() of the +templated class CleanupClose<class T>. This is +implemented by simply calling the Close() member function +of RTestTwo. This means that RTestTwo must +define or inherit a member function Close() which performs +whatever clean up is required.

+
Note
    +
  • In practice, this type +of cleanup operation is commonly applied to handles which are constructed +on the program stack.

  • +
+
\ No newline at end of file