diff -r 000000000000 -r c316ab048e9d browser/engine/inc/ResetAndDestroy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browser/engine/inc/ResetAndDestroy.h Fri Jun 25 12:50:05 2010 +0200 @@ -0,0 +1,27 @@ +/* + * Helper classes + */ + +//#include + +/* + * Function passed in as a parameter to TCleanupItem constructor to reset and + * destroy the received aPtr. + * @param aPtr A pointer to the object that is to be cleaned up + */ +inline void ResetAndDestroy(TAny* aPtr) +{ + reinterpret_cast(aPtr)->ResetAndDestroy(); +} + +/* + * Function that creates a cleanup item for aArray and specifies the cleanup + * function as ResetAndDestroy. When the item is removed from the cleanup stack + * the function ResetAndDestroy will be called on aArray. + * @param aArray The array to be destroyed. + */ +inline void CleanupResetAndDestroyPushL(RImplInfoPtrArray& aArray) +{ + TCleanupItem item(ResetAndDestroy, &aArray); + CleanupStack::PushL(item); +}