Remove C++ template declarance from C linkage 22/106022/1
authorKyungwook Tak <k.tak@samsung.com>
Tue, 20 Dec 2016 07:47:09 +0000 (16:47 +0900)
committerKyungwook Tak <k.tak@samsung.com>
Tue, 20 Dec 2016 07:49:03 +0000 (16:49 +0900)
Change-Id: I8c6655f1adff33300619218a86f5ac146949affb
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
tappsd/inc/drm_intf_tapps.h
tappsd/src/db/DTapps2SqliteDB.cpp

index e86df0c..bcaa94f 100644 (file)
@@ -147,33 +147,6 @@ typedef enum {
 }
 
 /*************************************************************************************************************/
-
-/* 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;
 
index 4789f07..e06b4ac 100644 (file)
@@ -114,7 +114,7 @@ BOOL DTappsDBOpen(void *&pDb, const char* CallingFun)
        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
 
@@ -147,10 +147,9 @@ BOOL DTappsDBOpen(void *&pDb, const char* CallingFun)
 
 MCATCH_B
 
-       if (true == IsMemAllocated)
-       {
-               MDELETE(pDBConnectionInfo);
-       }
+       if (IsMemAllocated && pDBConnectionInfo)
+               delete pDBConnectionInfo;
+
        DRM_TAPPS_EXCEPTION("This fn fails");
 
        return FALSE;