browser/engine/inc/ResetAndDestroy.h
changeset 0 c316ab048e9d
equal deleted inserted replaced
-1:000000000000 0:c316ab048e9d
       
     1 /*
       
     2  * Helper classes
       
     3  */
       
     4 
       
     5 //#include <ecom/ImplementationInformation.h>
       
     6 
       
     7 /*
       
     8  * Function passed in as a parameter to TCleanupItem constructor to reset and 
       
     9  * destroy the received aPtr.
       
    10  * @param aPtr A pointer to the object that is to be cleaned up
       
    11  */
       
    12 inline void ResetAndDestroy(TAny* aPtr)
       
    13 {
       
    14     reinterpret_cast<RImplInfoPtrArray*>(aPtr)->ResetAndDestroy();
       
    15 }
       
    16 
       
    17 /*
       
    18  * Function that creates a cleanup item for aArray and specifies the cleanup
       
    19  * function as ResetAndDestroy. When the item is removed from the cleanup stack
       
    20  * the function ResetAndDestroy will be called on aArray.
       
    21  * @param aArray The array to be destroyed.
       
    22  */
       
    23 inline void CleanupResetAndDestroyPushL(RImplInfoPtrArray& aArray)
       
    24 {       
       
    25     TCleanupItem item(ResetAndDestroy, &aArray);
       
    26     CleanupStack::PushL(item);
       
    27 }