1.If app run in background and not support multitasking,
app will quit immediatly, window will be desotried,
then exception will happen, so ahead timing of addon
event to avid window is null, ahead timing of addon event
contentDidFinishLoad.
2.Set timeout to 0 for app.quit(), then it will be a little
delay, it can avoid crash.
Change-Id: I8c0cc11f13c48384e5a3e1965a1fc27353e81a3a
Signed-off-by: liwei <wei90727.li@samsung.com>
console.log('webContents did-finish-load');
this.loadFinished = true;
wrt.hideSplashScreen(1);
+ addonManager.emit('contentDidFinishLoad', this.mainWindow.id);
if (wrt.isIMEWebApp()) {
this.activateIMEWebHelperClient();
} else if (wrt.tv) {
else
this.suspendByStatus();
}
- addonManager.emit('contentDidFinishLoad', this.mainWindow.id);
});
}
this.suspended = true;
this.windowList[this.windowList.length - 1].hide();
this.flushData();
- if (!this.backgroundRunnable()) {
- if (!this.multitaskingSupport) {
+ this.windowList.forEach((window) => window.setEnabled(false));
+ if (!this.backgroundRunnable() && !this.multitaskingSupport) {
+ setTimeout(() => {
console.log('multitasking is not supported; quitting app')
app.quit();
- } else {
- this.windowList.forEach((window) => window.setEnabled(false));
- }
+ }, 0);
}
}