From: DongHyun Song Date: Mon, 12 Oct 2020 08:32:23 +0000 (+0900) Subject: [TV] Bring cancelDialogs() forward to before-quit X-Git-Tag: accepted/tizen/unified/20201029.124952~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F53%2F245553%2F4;p=platform%2Fframework%2Fweb%2Fwrtjs.git [TV] Bring cancelDialogs() forward to before-quit With below refactor patch, https://review.tizen.org/gerrit/245417/ Defered timing of closing windows, Sometimes, JS exception is coming due to access of destroyed Object at wrt.tv.cancelDialogs(this.mainWindow.webContents); Change-Id: I207c890cb84e6aaec8ed13316c39b80dd2e6cd3c Signed-off-by: DongHyun Song --- diff --git a/wrt_app/src/web_application.ts b/wrt_app/src/web_application.ts index 3e5a683..3795a2a 100644 --- a/wrt_app/src/web_application.ts +++ b/wrt_app/src/web_application.ts @@ -381,22 +381,22 @@ Then you can get profile log from the initial loading.`; finalize() { console.log('WebApplication : finalize'); + this.flushData(); + this.windowList.forEach((window) => window.removeAllListeners()); + } + + quit() { + console.log('WebApplication : quit'); + addonManager.emit('lcQuit', this.mainWindow.id); if (wrt.tv) { this.inspectorSrc = ''; wrt.tv.cancelDialogs(this.mainWindow.webContents); } - this.flushData(); if (this.debugPort) { console.log('stop inspector server'); this.debugPort = 0; wrt.stopInspectorServer(); } - this.windowList.forEach((window) => window.removeAllListeners()); - } - - quit() { - console.log('WebApplication : quit'); - addonManager.emit('lcQuit', this.mainWindow.id); this.inQuit = true; if (!this.suspended) this.suspend();