From: Hyungju Lee Date: Tue, 21 Apr 2020 02:16:38 +0000 (+0900) Subject: Fix to call CoreRuntime dispose() X-Git-Tag: accepted/tizen/unified/20200422.032241 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Faccepted%2Ftizen%2Funified%2F20200422.032241;p=platform%2Fcore%2Fdotnet%2Flauncher.git Fix to call CoreRuntime dispose() Change-Id: I33f4a07bee4b69195f331952acb699b39e17c9e9 --- diff --git a/NativeLauncher/launcher/exec/launcher.cc b/NativeLauncher/launcher/exec/launcher.cc index 84afd91..f90650c 100644 --- a/NativeLauncher/launcher/exec/launcher.cc +++ b/NativeLauncher/launcher/exec/launcher.cc @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) } } - CoreRuntime* runtime = new CoreRuntime("standalone"); + std::unique_ptr runtime(new CoreRuntime("standalone")); // get app ID and app root path if (AUL_R_OK == aul_app_get_appid_bypid(getpid(), appId, sizeof(appId))) { diff --git a/NativeLauncher/launcher/exec/loader.cc b/NativeLauncher/launcher/exec/loader.cc index dda9368..27602b8 100644 --- a/NativeLauncher/launcher/exec/loader.cc +++ b/NativeLauncher/launcher/exec/loader.cc @@ -190,7 +190,10 @@ extern "C" int realMain(int argc, char *argv[], const char* mode) .remove_fd = __adapter_remove_fd }; - return launchpad_loader_main(argc, argv, &callbacks, &adapter, runtime); + int ret = launchpad_loader_main(argc, argv, &callbacks, &adapter, runtime); + delete runtime; + + return ret; } int main(int argc, char *argv[])