Skip to content

Commit

Permalink
chore: attempt to kill Nitro subprocesses (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan authored Oct 27, 2023
1 parent fce61f5 commit 1439742
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ app.on("window-all-closed", () => {
app.quit();
});

app.on("quit", () => {
dispose(requiredModules);
app.quit();
});

ipcMain.handle("setNativeThemeLight", () => {
nativeTheme.themeSource = "light";
});
Expand Down
7 changes: 7 additions & 0 deletions plugins/inference-plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,14 @@ const registerListener = () => {
events.on(EventName.OnNewMessageRequest, handleMessageRequest);
};

const killSubprocess = () => {
invokePluginFunc(MODULE_PATH, "killSubprocess");
};

const onStart = async () => {
// Try killing any existing subprocesses related to Nitro
killSubprocess();

registerListener();
};
// Register all the above functions and objects with the relevant extension points
Expand Down

0 comments on commit 1439742

Please sign in to comment.