From: Eunki, Hong Date: Wed, 3 Aug 2022 10:58:34 +0000 (+0900) Subject: [Tizen] Fix crash issue when mArgc / mArgv is null at Tizen X-Git-Tag: accepted/tizen/unified/20220804.041712^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F10%2F279210%2F1;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git [Tizen] Fix crash issue when mArgc / mArgv is null at Tizen Only for tizen case, we should use at least one argments. But if application created by dotnet launcher, It could be nullptr. Other platform (like ubuntu / windows / etc..) don't need to add dummy Arguments. So here, we try to attach some dummy arguments only for tizen platform case. Change-Id: Ib02a181e8579966ae2e9600bb27eecd040032c1d Signed-off-by: Eunki, Hong --- diff --git a/dali/internal/adaptor/tizen-wayland/framework-tizen.cpp b/dali/internal/adaptor/tizen-wayland/framework-tizen.cpp index d0b25e1..2886cf2 100644 --- a/dali/internal/adaptor/tizen-wayland/framework-tizen.cpp +++ b/dali/internal/adaptor/tizen-wayland/framework-tizen.cpp @@ -91,6 +91,11 @@ bool IsWidgetFeatureEnabled() return feature; } +// Note : tizen appfw don't consider zero-arguments case. +// If framework argc & argv is nullptr, We should add at least one argv. +const int gTizenDummyArgc = 1; +const char* gTizenDummyArgv[1] = {"dali-tizen-app"}; + } // anonymous namespace namespace AppCore @@ -1162,7 +1167,6 @@ struct Framework::Impl callback.fini = ComponentAppFinish; return component_based_app_base_main(*mFramework->mArgc, *mFramework->mArgv, &callback, mFramework); - ; } static void* ComponentAppCreate(void* data) @@ -1219,6 +1223,12 @@ Framework::Framework(Framework::Observer& observer, Framework::TaskObserver& tas mAbortHandler(MakeCallback(this, &Framework::AbortCallback)), mImpl(NULL) { + if(mArgc == nullptr || mArgv == nullptr) + { + mArgc = const_cast(&gTizenDummyArgc); + mArgv = const_cast(reinterpret_cast(&gTizenDummyArgv)); + } + bool featureFlag = true; system_info_get_platform_bool("tizen.org/feature/opengles.version.2_0", &featureFlag);