From: Youngsoo Choi Date: Thu, 29 Aug 2019 03:24:18 +0000 (-0700) Subject: fixup! [WRT Service] Provide sandbox context per servcie app and support legacy APIs X-Git-Tag: submit/tizen/20190920.002515~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a7e071b42ef39758baa32ae1740a24b9df217ec9;p=platform%2Fframework%2Fweb%2Fwrtjs.git fixup! [WRT Service] Provide sandbox context per servcie app and support legacy APIs This calls client process termination after loading each service app. Change-Id: Ida5ff3044e233f6d135acf3e7fdd958e58b705b5 Signed-off-by: Youngsoo Choi --- diff --git a/wrt_app/service/main.js b/wrt_app/service/main.js index 9b1edad..782fd2e 100755 --- a/wrt_app/service/main.js +++ b/wrt_app/service/main.js @@ -30,6 +30,10 @@ wrt.on('start-service', (event, app_id) => { }; let options = { filename: app_id }; vm.runInNewContext(wrt.readService(app_id), sandbox[app_id], options); + + if (!wrt.terminateClient(app_id)) { + console.log('Failed to terminate client process'); + } } if (sandbox[app_id]['started'] === undefined) { sandbox[app_id]['started'] = true; @@ -38,9 +42,6 @@ wrt.on('start-service', (event, app_id) => { } const request_callback_string = 'if (module.exports.onRequest !== undefined) { module.exports.onRequest(); }'; vm.runInContext(request_callback_string, sandbox[app_id]); - if (!wrt.terminateClient(app_id)) { - console.log('Failed to terminate client process'); - } }) process.on('exit', (code) => {