Cleanup utilities

The Cleanup utility functions support four types of clean up operation.

The cleanup utility functions offer easy ways of constructing a TCleanUpItem and pushing it onto the cleanup stack. They support four types of clean up operation:

  • where the object is deleted: template <class T> void CleanupDeletePushL(T*)

  • where the object's Close() member function is called: template <class T> void CleanupClosePushL(T&)

  • where the object's Release() member function is called: template <class T> void CleanupReleasePushL(T&)

  • where an array of objects is deleted: template <class T> void CleanupArrayDeletePushL(T*)

The functions have the supporting templated classes:

  • CleanupDelete<class T>

  • CleanupClose<class T>

  • CleanupRelease<class T>

  • CleanupArrayDelete<class T>

The way in which these work is best illustrated graphically by taking CleanupClosePushL() as an example. See the diagram below.

Figure: Effect of CleanupClosePushL and subsequent pop and destroy