--- a/taskswitcher/utils/inc/tsutils.h Wed Oct 13 12:59:22 2010 +0300
+++ b/taskswitcher/utils/inc/tsutils.h Mon Oct 18 10:44:15 2010 +0300
@@ -14,8 +14,23 @@
* Description:
*
*/
+#ifndef TSUTILS_H
+#define TSUTILS_H
+#include <e32base.h>
+namespace TaskSwitcher {
+ template <class T>
+ void CArrayPtrCleanupMethod(TAny *aPtr)
+ {
+ CArrayPtr<T> *ptr(static_cast< CArrayPtr<T>* >(aPtr));
+ ptr->ResetAndDestroy();
+ delete ptr;
+ }
+
+ template <class T>
+ void CleanupResetAndDestroyPushL(CArrayPtr<T> *array) {
+ CleanupStack::PushL(TCleanupItem(&CArrayPtrCleanupMethod<T>, array));
+ }
-namespace TaskSwitcher {
template <class T>
void RPointerArrayCleanupMethod(TAny *aPtr)
{
@@ -26,4 +41,5 @@
void CleanupResetAndDestroyPushL(RPointerArray<T> &array) {
CleanupStack::PushL(TCleanupItem(&RPointerArrayCleanupMethod<T>, &array));
}
-}
\ No newline at end of file
+}
+#endif//TSUTILS_H