Fix finalize code 81/259881/1 submit/submit/tizen_6.0/20210617.021127/20210617.021112 submit/tizen_6.0/20210617.021127
authorSangYong Park <sy302.park@samsung.com>
Wed, 16 Jun 2021 08:26:12 +0000 (17:26 +0900)
committerSangYong Park <sy302.park@samsung.com>
Wed, 16 Jun 2021 08:32:12 +0000 (17:32 +0900)
'quit' of app and 'closed' of BrowserWindow emit order is changed.
so, fix code that has dependency to remained BrowserWindow.

Reference:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/259880/

Change-Id: Ib988f230822c94becbf1d735f82fe85b22250f66
Signed-off-by: SangYong Park <sy302.park@samsung.com>
wrt_app/src/web_application.ts

index 60d7be2cce238932085572635c7cdee15d290233..8015a3df277259d30abf37aca5d50042c547b930 100755 (executable)
@@ -16,7 +16,7 @@
 
 'use strict';
 
-import { app, protocol } from 'electron';
+import { app, protocol, session } from 'electron';
 import { wrt } from '../browser/wrt';
 import * as WRTWebContents from '../browser/wrt_web_contents';
 import { WRTWindow } from '../browser/wrt_window';
@@ -351,7 +351,8 @@ Then you can get profile log from the initial loading.`;
     console.log('WebApplication : suspend');
     addonManager.emit('lcSuspend', this.mainWindow.id);
     this.suspended = true;
-    this.windowList[this.windowList.length - 1].hide();
+    if (this.windowList.length > 0)
+      this.windowList[this.windowList.length - 1].hide();
     this.flushData();
     if (!this.backgroundRunnable()) {
       if (!this.multitaskingSupport) {
@@ -406,7 +407,7 @@ Then you can get profile log from the initial loading.`;
 
   private flushData() {
     console.log('WebApplication : FlushData');
-    this.windowList.forEach((window) => window.webContents.session.flushStorageData());
+    session.defaultSession?.flushStorageData();
   }
 
   sendAppControlEvent() {