Fix memory leak of callback 20/239620/1
authorHeeyong Song <heeyong.song@samsung.com>
Tue, 28 Jul 2020 07:56:04 +0000 (16:56 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Tue, 28 Jul 2020 07:56:04 +0000 (16:56 +0900)
Change-Id: I4b62eb7a1ead054f24505a8fc4a4a96956a9e173

dali/internal/adaptor/common/adaptor-impl.cpp

index e111bdb..e73d5a2 100644 (file)
@@ -1212,6 +1212,12 @@ bool Adaptor::AddIdleEnterer( CallbackBase* callback, bool forceAdd )
     idleAdded = mCallbackManager->AddIdleEntererCallback( callback );
   }
 
+  if( !idleAdded )
+  {
+    // Delete callback
+    delete callback;
+  }
+
   return idleAdded;
 }