Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call the osn.nodeobs.ipc.disconnect() function causes ELETRON to exit directly #1061

Open
naas1d513215 opened this issue Feb 10, 2022 · 2 comments

Comments

@naas1d513215
Copy link

No description provided.

@aza547
Copy link

aza547 commented Dec 28, 2022

This is also causing me problems, is it expected?

I'm using obs-studio-node to power the recording in Warcraft Recorder.

I'd love to be able to shutdown OBS when the WoW process isn't running to ensure all devices are released - we have an issue that windows won't go to sleep as a result of this just now even when the app is idling.

I'm shutting down in a similar fashion as I can see in the tests here:

  async shutdown() {
    console.info('[Recorder] OBS shutting down');

    try {
      osn.NodeObs.OBS_service_removeCallback();
      osn.NodeObs.IPC.disconnect();
    } catch (e) {
      throw Error(`Exception when shutting down OBS process: ${e}`);
    }

    this.obsInitialized = false;
    console.info('[Recorder] OBS shut down successfully');
  }

Thanks in advance.

@aza547
Copy link

aza547 commented Dec 28, 2022

Seems adding some extra calls as per the steamlabs desktop client code helps, not tested this to confirm it's good yet but electron doesn't exit with:

  async shutdown() {
    console.info('[Recorder] OBS shutting down');

    try {
      osn.NodeObs.InitShutdownSequence();
      osn.NodeObs.RemoveSourceCallback();
      osn.NodeObs.OBS_service_removeCallback();
      osn.NodeObs.IPC.disconnect();
    } catch (e) {
      throw new Error(`Exception when shutting down OBS process: ${e}`);
    }

    this.obsInitialized = false;
    console.info('[Recorder] OBS shut down successfully');
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants