fix unreleased exit and errata in ini
authorpius.lee <pius.lee@samsung.com>
Mon, 1 Aug 2016 01:28:03 +0000 (10:28 +0900)
committerpius.lee <pius.lee@samsung.com>
Mon, 1 Aug 2016 01:28:03 +0000 (10:28 +0900)
packaging/dotnet-launcher.ini
src/launcher.cc
src/launcher.h

index 8b8204b..dae9223 100644 (file)
@@ -1,5 +1,5 @@
 [dotnet]
 libcoreclr = libcoreclr.so
 coreclr_dir = /usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.0
-tpa_dirs = /usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.0:/usr/share/assemblies
-native_so_search_dirs = /usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.0:/usr/share/assemblies
+tpa_dirs = /usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.0:/usr/share/assembly
+native_so_search_dirs = /usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.0:/usr/share/assembly
index 66bc440..088f1be 100644 (file)
@@ -239,14 +239,6 @@ void Launcher::Initialize()
   }
 }
 
-void Launcher::Dispose()
-{
-  if (dlclose(coreclrLib) != 0)
-  {
-    _ERR("libcoreclr.so close failed");
-  }
-}
-
 void Launcher::Launch(const string& exe_path, int argc, char *argv[])
 {
   std::string bin_path = Basename(AbsolutePath(exe_path));
@@ -299,26 +291,28 @@ void Launcher::Launch(const string& exe_path, int argc, char *argv[])
     // initialize coreclr fail
     _ERR("initialize core clr fail! (0x%08x)", st);
     _DBG("check your smack label dll and every directories on the way to dlls");
-    exit(-1);
   }
-
-  unsigned int exitCode;
-  st = executeAssembly(hostHandle, domainId,
-      argc, const_cast<const char**>(argv), exe_path.c_str(), &exitCode);
-  if (st < 0)
+  else
   {
-    // execute coreclr fail
-    _ERR("execute core clr fail! (0x%08x)", st);
-    exit(-1);
+    unsigned int exitCode;
+    const char** argvc = const_cast<const char**>(argv);
+    st = executeAssembly(hostHandle, domainId, argc, argvc, exe_path.c_str(), &exitCode);
+    _DBG("after execute coreclr");
+    if (st < 0)
+    {
+      // execute coreclr fail
+      _ERR("execute core clr fail! (0x%08x / %d)", st, exitCode);
+    }
+    st = shutdownCoreCLR(hostHandle, domainId);
+    if (st < 0)
+    {
+      // shutdown fail
+      _ERR("shutdown core clr fail! (0x%08x)", st);
+    }
   }
-  _DBG("after execute coreclr");
-
-  st = shutdownCoreCLR(hostHandle, domainId);
-  if (st < 0)
+  if (dlclose(coreclrLib) != 0)
   {
-    // shutdown fail
-    _ERR("shutdown core clr fail! (0x%08x)", st);
-    exit(-1);
+    _ERR("libcoreclr.so close failed");
   }
 }
 
index 946fed4..7030f85 100644 (file)
@@ -34,7 +34,6 @@ class Launcher
     Launcher();
     ~Launcher();
     void Initialize();
-    void Dispose();
     void Launch(const string& exe_path, int argc, char *argv[]);
 
   private: