Skip to content

Commit

Permalink
[Tizen] Handle relaunching event in example apps (#19090)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlatusek authored and pull[bot] committed Jan 20, 2024
1 parent 1a590ea commit 1306401
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
17 changes: 10 additions & 7 deletions examples/platform/tizen/TizenServiceAppMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,16 @@ void TizenServiceAppMain::AppTerminated()
void TizenServiceAppMain::AppControl(app_control_h app_control)
{
ChipLogProgress(NotSpecified, "Tizen app control");

mLinuxArgs.Parse(mArgc > 0 ? mArgv[0] : nullptr, app_control);
if (ChipLinuxAppInit(mLinuxArgs.argc(), const_cast<char **>(mLinuxArgs.argv())) != 0)
if (!initialized)
{
service_app_exit();
return;
mLinuxArgs.Parse(mArgc > 0 ? mArgv[0] : nullptr, app_control);
if (ChipLinuxAppInit(mLinuxArgs.argc(), const_cast<char **>(mLinuxArgs.argv())) != 0)
{
service_app_exit();
return;
}

mLinuxThread = std::thread(ChipLinuxAppMainLoop);
initialized = true;
}

mLinuxThread = std::thread(ChipLinuxAppMainLoop);
}
1 change: 1 addition & 0 deletions examples/platform/tizen/TizenServiceAppMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ class TizenServiceAppMain
char ** mArgv = nullptr;
OptionsProxy mLinuxArgs;
std::thread mLinuxThread;
bool initialized = false;
};

0 comments on commit 1306401

Please sign in to comment.