Skip to content

Commit

Permalink
Exit application method is replaced by 'ui_app_exit' (#3)
Browse files Browse the repository at this point in the history
The function 'exit(EXIT_SUCCESS)' terminates the calling process
immediately. The better way to exit process is to call 'ui_app_exit'
which invokes the terminate callback on main thread so that the
app can save its current status before exiting.
  • Loading branch information
xiaowei-guan authored Nov 28, 2020
1 parent 8e09988 commit 43be6f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions shell/platform/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ source_set("flutter_tizen") {

include_dirs = [
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/appfw",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/base",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/dlog",
"//third_party/tizen_tools/sysroot/$target_cpu/usr/include/ecore-1",
Expand All @@ -89,6 +90,7 @@ source_set("flutter_tizen") {

libs = [
"base-utils-i18n",
"capi-appfw-application",
"capi-system-info",
"capi-system-system-settings",
"dlog",
Expand Down
4 changes: 3 additions & 1 deletion shell/platform/tizen/channels/platform_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "platform_channel.h"

#include <app.h>

#include "flutter/shell/platform/common/cpp/json_method_codec.h"
#include "flutter/shell/platform/tizen/logger.h"

Expand All @@ -28,7 +30,7 @@ void PlatformChannel::HandleMethodCall(
const auto method = call.method_name();

if (method == "SystemNavigator.pop") {
exit(EXIT_SUCCESS);
ui_app_exit();
result->Success();
} else if (method == "SystemSound.play") {
result->NotImplemented();
Expand Down

0 comments on commit 43be6f5

Please sign in to comment.