[WRTjs] If app is quiting, don't call show app 56/279556/2 submit/tizen/20220812.160033
authorzhaosy <shiyusy.zhao@samsung.com>
Thu, 11 Aug 2022 10:40:05 +0000 (18:40 +0800)
committerzhaosy <shiyusy.zhao@samsung.com>
Thu, 11 Aug 2022 10:54:37 +0000 (18:54 +0800)
App will crash in below scenario, because all windows are closed,
so add protected code.

  App is quitting -> ready-to-show event is triggered
  -> visibility_callback -> GetMainNativeWindow

Change-Id: Ie71dc4ff71bf639a7059641a34b4819a7e97869a
Signed-off-by: zhaosy <shiyusy.zhao@samsung.com>
wrt_app/src/web_application.ts

index ff110c6..c7d497a 100644 (file)
@@ -210,6 +210,9 @@ export class WebApplication {
 
   private setupMainWindowEventListener() {
     this.mainWindow.once('ready-to-show', () => {
+      if (this.inQuit)
+        return;
+
       console.log('mainWindow ready-to-show');
       if (this.showTimer)
         clearTimeout(this.showTimer);