phonebookengines/VirtualPhonebook/inc/CVPbkETelCntConverter.h
branchRCL_3
changeset 32 2828b4d142c0
parent 0 e686773b3f54
child 64 c1e8ba0c2b16
--- a/phonebookengines/VirtualPhonebook/inc/CVPbkETelCntConverter.h	Tue Apr 27 16:23:35 2010 +0300
+++ b/phonebookengines/VirtualPhonebook/inc/CVPbkETelCntConverter.h	Tue May 11 16:00:21 2010 +0300
@@ -147,6 +147,22 @@
         TInt iMinContactLength;
     };
 
+// CleanupStack helpers for item owning RPointerArrays
+template <class T>
+class CleanupResetAndDestroy
+    {
+public:
+    inline static void PushL(T& aRef)
+        { CleanupStack::PushL(TCleanupItem(&ResetAndDestroy,&aRef)); }
+private:
+    inline static void ResetAndDestroy(TAny *aPtr)
+        { static_cast<T*>(aPtr)->ResetAndDestroy(); }
+    };
+
+template <class T>
+inline void CleanupResetAndDestroyPushL(T& aRef)
+    { CleanupResetAndDestroy<T>::PushL(aRef); }
+
 #endif      // CVPBKETELCNTCONVERTER_H
             
 // End of File