Reset gPreInitializedApplication to reduce reference count
[platform/core/uifw/dali-adaptor.git] / 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()