To guarantee unload* events, suspend() should be deffered after
closing windows.
Related patch:
https://review.tizen.org/gerrit/246015/
https://review.tizen.org/gerrit/245417/
Change-Id: Id13a275b64e75f985e0115eee6771e3c29dd9cd9
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
}
suspend() {
- if (this.suspended)
+ if (this.suspended || this.inQuit)
return;
console.log('WebApplication : suspend');
addonManager.emit('lcSuspend', this.mainWindow.id);
this.suspended = true;
this.windowList[this.windowList.length - 1].hide();
this.flushData();
- if (!this.backgroundRunnable() || this.inQuit) {
+ if (!this.backgroundRunnable()) {
if (!this.multitaskingSupport) {
// FIXME : terminate app after visibilitychange event handling
setTimeout(() => {
console.log('WebApplication : finalize');
this.flushData();
this.windowList.forEach((window) => window.removeAllListeners());
+ this.inQuit = false;
+ if (!this.suspended)
+ this.suspend();
}
quit() {
wrt.stopInspectorServer();
}
this.inQuit = true;
- if (!this.suspended)
- this.suspend();
}
private flushData() {