Some apps(ex. hulu) will call window.close() when terminate, it will cause
'before-quit' invoked after 'window-all-closed'. In current logic, WRT stop
inspector when receive 'before-quit' event, but at this case, any wrt api
cannot be called successfully(I think it's related with window is closed firstly),
so stop inspector in 'window-all-closed' event, then RWI cannot stopped properly and
RWI port will be released normally
Change-Id: I8d3d46973cc1536bf6818c346d7c3ef43ed4be0a
Signed-off-by: liwei <wei90727.li@samsung.com>
app.on('window-all-closed', () => {
console.log('window-all-closed');
+ this.webApplication?.stopInspector();
app.quit();
});
}
}
+ stopInspector() {
+ if (this.debugPort) {
+ console.log('stop inspector server');
+ this.debugPort = 0;
+ wrt.stopInspectorServer();
+ }
+ }
+
loadUrl(appControl: NativeWRTjs.AppControl) {
this.contentSrc = appControl.getLoadInfo().getSrc();
this.launchInspectorIfNeeded(appControl);
console.log('WebApplication : beforeQuit');
this.profileDelegate.beforeQuit();
addonManager.emit('lcQuit', this.mainWindow.id);
- if (this.debugPort) {
- console.log('stop inspector server');
- this.debugPort = 0;
- wrt.stopInspectorServer();
- }
+ this.stopInspector();
this.inQuit = true;
}