Avoid Svace MEMORY_LEAK warning in callback.cpp 38/130338/1
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 22 May 2017 05:04:55 +0000 (14:04 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 22 May 2017 05:06:52 +0000 (14:06 +0900)
Change-Id: I7be6559a82035993e8607b282b6ecc47ec365264
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
dali/public-api/signals/callback.cpp

index 841b1df..6bbf33f 100644 (file)
@@ -45,18 +45,24 @@ CallbackBase::CallbackBase( void* object, MemberFunction function, Dispatcher di
 : mMemberFunction( function )
 {
   mImpl = new CallbackBase::Impl;
-  mImpl->mObjectPointer = object;
-  mImpl->mMemberFunctionDispatcher = dispatcher;
-  mImpl->mDestructorDispatcher = NULL; // object is not owned
+  if( mImpl )
+  {
+    mImpl->mObjectPointer = object;
+    mImpl->mMemberFunctionDispatcher = dispatcher;
+    mImpl->mDestructorDispatcher = NULL; // object is not owned
+  }
 }
 
 CallbackBase::CallbackBase( void* object, MemberFunction function, Dispatcher dispatcher, Destructor destructor )
 : mMemberFunction( function )
 {
   mImpl = new CallbackBase::Impl;
-  mImpl->mObjectPointer = object;
-  mImpl->mMemberFunctionDispatcher = dispatcher;
-  mImpl->mDestructorDispatcher = destructor; // object is owned
+  if( mImpl )
+  {
+    mImpl->mObjectPointer = object;
+    mImpl->mMemberFunctionDispatcher = dispatcher;
+    mImpl->mDestructorDispatcher = destructor; // object is owned
+  }
 }
 
 void CallbackBase::Reset()