check runtime initialize before launch application to avoid crash 75/183675/1 submit/tizen/20180710.012701
authorWoongsuk Cho <ws77.cho@samsung.com>
Tue, 10 Jul 2018 01:18:40 +0000 (10:18 +0900)
committerWoongsuk Cho <ws77.cho@samsung.com>
Tue, 10 Jul 2018 01:18:40 +0000 (10:18 +0900)
Change-Id: I142bd6f5ab42414d0f9183535751143a3e20d3e3

NativeLauncher/launcher/dotnet/dotnet_launcher.cc
NativeLauncher/launcher/dotnet/dotnet_launcher.h

index 6ae5ad5..2b2006c 100644 (file)
@@ -91,7 +91,8 @@ CoreRuntime::CoreRuntime(const char* mode) :
        __hostHandle(nullptr),
        __domainId(-1),
        fd(0),
-       __mode(mode)
+       __mode(mode),
+       __initialized(false)
 {
        _DBG("Constructor called!!");
 
@@ -185,6 +186,8 @@ int CoreRuntime::initialize(bool standalone)
                return -1;
        }
 
+       __initialized = true;
+
        return 0;
 }
 
@@ -255,9 +258,14 @@ void CoreRuntime::dispose()
 
 int CoreRuntime::launch(const char* appId, const char* root, const char* path, int argc, char* argv[])
 {
+       if (!__initialized) {
+               _ERR("Runtime is not initialized");
+               return -1;
+       }
+
        if (path == nullptr) {
                _ERR("executable path is null");
-               return -11;
+               return -1;
        }
 
        if (!isFileExist(path)) {
index 82052f2..647640a 100644 (file)
@@ -46,6 +46,7 @@ class CoreRuntime
                unsigned int __domainId;
                int fd;
                const char* __mode;
+               bool __initialized;
 };
 
 }  // dotnetcore