desktop icon indicating copy to clipboard operation
desktop copied to clipboard

fixed a typo which prevents the child window to close correctly when the OBS initialization fails

Open eugen15 opened this issue 2 years ago • 2 comments

In the current production code, if obs.NodeObs.OBS_API_initAPI fails, the child window process does not close. Some processes still stay in memory. This does not allow you to start Streamlabs Desktop again. The typo correction fixes the issue.

It is interesting why the same issue does not happen when the application is closed by a user via the close button. In this case the uninitialization is different. The shutdownHandler method is called. It does this.windowsService.shutdown() which closes the windows.

private shutdownHandler() {
  ...
  window.setTimeout(async () => {
    ...
    this.windowsService.shutdown();

So, if the typo correction is not acceptable because app.quit was never actually called before, and it may break the other steps of the uninitialization, then you can add something like this appService.windowsService.closeOneOffWindow('child') to the following code before obs.IPC.disconnect():

if (apiResult !== obs.EVideoCodes.Success) {
  const message = apiInitErrorResultToMessage(apiResult);
  showDialog(message);

  ipcRenderer.send('unregister-in-crash-handler', { pid: process.pid });

  obs.NodeObs.InitShutdownSequence();
  obs.IPC.disconnect();

  electron.ipcRenderer.send('shutdownComplete');
  return;
}

eugen15 avatar Jul 20 '22 20:07 eugen15

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jul 20 '22 20:07 CLAassistant

BundleMon

Files added (4)
Status Path Size Limits
:white_check_mark: renderer.(hash).js
+6.13MB -
:white_check_mark: vendors~renderer.(hash).js
+5.01MB -
:white_check_mark: updater.js
+114.99KB -
:white_check_mark: guest-api.js
+40.18KB -

Total files change +11.29MB 0%

Final result: :white_check_mark:

View report in BundleMon website ➡️


Current branch size history

bundlemon[bot] avatar Jul 20 '22 20:07 bundlemon[bot]