Fix extension cleanup issue 43/182943/1
authorSangYong Park <sy302.park@samsung.com>
Fri, 29 Jun 2018 04:41:41 +0000 (13:41 +0900)
committerSangYong Park <sy302.park@samsung.com>
Fri, 29 Jun 2018 04:41:41 +0000 (13:41 +0900)
Exception is occured when extension cleanup by web device api. (exit())
because, before-quit event did not occur.

Change-Id: Iea468e56347ab14459fa5b4b4b6e21ac64ba8371
Signed-off-by: SangYong Park <sy302.park@samsung.com>
atom/browser/api/atom_api_web_contents.cc
wrt/src/main.js

index c7d84263076715673f525449706e6afc5ff54c18..7e3e1764c36aa58f261610e8c3001640e16e47b0 100644 (file)
@@ -938,8 +938,7 @@ void WebContents::HandleWrtPluginMessage(Ewk_Wrt_Message_Data* msg) {
     Eina_Stringshare* msg_ref_id = msg->GetReferenceId();
     Eina_Stringshare* msg_value = msg->GetValue();
     if (TYPE_IS("tizen://exit")) {
-      atom::Browser *browser_model = atom::Browser::Get();
-      browser_model->Shutdown();
+      atom::Browser::Get()->Quit();
     }
 
     eina_stringshare_del(msg_ref_id);
index e1ee03f2ed5a4d6785b44a2e5b02b3c441368e35..b84ef59ffe737626370dceeda8bfb6adea07e253 100644 (file)
@@ -14,6 +14,13 @@ const yargs = require('yargs');
         process.env.DEBUG = originalDebug;
 }
 
+process.on('uncaughtException', function (error) {
+  // Do nothing if the user has a custom uncaught exception handler.
+  var ref, stack
+  stack = (ref = error.stack) != null ? ref : error.name + ': ' + error.message
+  console.error('A JavaScript error occurred in the main process\n' + stack)
+})
+
 let parseCommandLine = function() {
     let options = yargs(process.argv.slice(1)).wrap(80);
     options.usage('WebRuntime');