Skip to content

Commit

Permalink
Merge pull request LykosAI#656 from ionite34/fix-sdfx-exit
Browse files Browse the repository at this point in the history
Fixed Sdfx electron window not closing when stopping the app
  • Loading branch information
ionite34 authored Jun 6, 2024
2 parents 651a82a + 7b674cb commit 5a4cc5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
- Fixed missing progress text during package updates
- Fixed "Git and Node.js are required" error during SDFX install
- (Windows) Fixed "Open in Explorer" buttons across the app not opening the correct path on ReFS partitions
- (Windows) Fixed Sdfx electron window not closing when stopping the package
- (macOS, Linux) Fixed Subprocesses of packages sometimes not being closed when the app is closed
- Fixed Inference tabs sometimes not being restored from previous sessions
- Fixed multiple log files being archived in a single session, and losing some log entries
Expand Down
6 changes: 6 additions & 0 deletions StabilityMatrix.Core/Models/Packages/Sdfx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ void HandleConsoleOutput(ProcessOutput s)
var args = $"\"{Path.Combine(installedPackagePath, command)}\" --run {arguments}";

venvRunner.RunDetached(args.TrimEnd(), HandleConsoleOutput, OnExit);

// Cuz node was getting detached on process exit
if (Compat.IsWindows)
{
ProcessTracker.AttachExitHandlerJobToProcess(venvRunner.Process);
}
}

private Dictionary<string, string> GetEnvVars(PyVenvRunner venvRunner, DirectoryPath installPath)
Expand Down

0 comments on commit 5a4cc5a

Please sign in to comment.