Change-Id: I8c6655f1adff33300619218a86f5ac146949affb
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
}
/*************************************************************************************************************/
-
-/* New and Delete */
-
-#include <new>
-#define NEW new (std::nothrow)
-
-#define MDELETE(x) \
-{ \
- if (x) { \
- delete x; \
- x=0; \
- } \
-}
-
-#define MDELETES(x) \
-{ \
- if (x) { \
- delete [] x; \
- x=0; \
- } \
-}
-
-#define MDELETE0 MDELETE
-
-#define MDELETES0 MDELETES
-
-/*************************************************************************************************************/
/* Mutex structure */
typedef pthread_mutex_t dtapps_mutex_t;
else
{
DRM_TAPPS_LOG("no connection exists.. pairCount=[%ld]", pairCount);
- pDBConnectionInfo = NEW DtappsDBConnectionInfo;
+ pDBConnectionInfo = new(std::nothrow) DtappsDBConnectionInfo;
MTRY_BL(NULL != pDBConnectionInfo);
IsMemAllocated = true; // prevent fix
MCATCH_B
- if (true == IsMemAllocated)
- {
- MDELETE(pDBConnectionInfo);
- }
+ if (IsMemAllocated && pDBConnectionInfo)
+ delete pDBConnectionInfo;
+
DRM_TAPPS_EXCEPTION("This fn fails");
return FALSE;