[Tizen] Don't use pre-initialized app in case of WidgetApplication 39/274339/1
authorHeeyong Song <heeyong.song@samsung.com>
Mon, 25 Apr 2022 02:34:57 +0000 (11:34 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 27 Apr 2022 00:19:07 +0000 (09:19 +0900)
Change-Id: I80c4ef6b89191471aa73f99d1b1a731f41fb7add

dali/public-api/adaptor-framework/widget-application.cpp

index 05444c0..d7bc085 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,6 +25,13 @@ namespace Dali
 {
 WidgetApplication WidgetApplication::New(int* argc, char** argv[], const std::string& stylesheet)
 {
+  Internal::Adaptor::ApplicationPtr preInitializedApplication = Internal::Adaptor::Application::GetPreInitializedApplication();
+  if(preInitializedApplication)
+  {
+    // WidgetApplication can't use pre-initialized application. So reset it.
+    preInitializedApplication.Reset();
+  }
+
   Internal::Adaptor::WidgetApplicationPtr internal = Internal::Adaptor::WidgetApplication::New(argc, argv, stylesheet);
   return WidgetApplication(internal.Get());
 }