Merge "Reset gPreInitializedApplication to reduce reference count" into devel/master
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 20 Oct 2021 01:50:27 +0000 (01:50 +0000)
committerGerrit Code Review <gerrit@review>
Wed, 20 Oct 2021 01:50:27 +0000 (01:50 +0000)
dali/internal/adaptor/common/application-impl.cpp

index b942190..1311e2a 100644 (file)
@@ -456,7 +456,11 @@ void Application::SetDefaultWindowType(WindowType type)
 
 ApplicationPtr Application::GetPreInitializedApplication()
 {
-  return gPreInitializedApplication;
+  // Reset the handle to decrease the reference count
+  ApplicationPtr application = gPreInitializedApplication;
+  gPreInitializedApplication.Reset();
+
+  return application;
 }
 
 Graphics::Controller& Application::GetController()