Location:
e32base.inl
inline void CleanupReleasePushL(T &aRef);
Constructs and pushes a TCleanupItem
object onto the cleanup stack.
The TCleanupItem
encapsulates:
1. a reference aRef to the object of type class T which is to be cleaned up
2. an associated cleanup operation.
The cleanup operation is the private static function Release() of the templated class CleanupRelease
and is invoked as a result of a subsequent call to CleanupStack::PopAndDestroy()
.
CleanupRelease::Release()
is passed a pointer to the class T object to be cleaned up, and the function implements cleanup by calling Release() on the
passed object. The class T object must, therefore, define and implement (or inherit) a Release() member function.
An example of its use:
class RTestThree;
{
public :
...
IMPORT_C void Release();
...
}
...
RTestThree three;
CleanupReleasePushL(three);
...
CleanupStack::PopAndDestroy(); // <--- results in Release() being called on "three".
......
|