Skip to content

Commit

Permalink
Fixed SpiceClient.cs released thread of new process.
Browse files Browse the repository at this point in the history
  • Loading branch information
sakakun committed Nov 25, 2024
1 parent b9a8e0f commit 1d3c5c1
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Classes/consoles/SpiceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static void LaunchVirtViewer(string spiceObject)
{
FileName = FindRemoteViewerPath(),
Arguments = $"\"{tempFilePath}\"",
UseShellExecute = true, // Use shell execute to run the application directly
UseShellExecute = false, // Use shell execute to run the application directly
RedirectStandardError = true // Redirect standard error if needed
};

Expand All @@ -134,14 +134,7 @@ public static void LaunchVirtViewer(string spiceObject)
}
finally
{
// Clean up the temporary file after a short delay to ensure the process has started
Task.Delay(100).ContinueWith(_ =>
{
if (File.Exists(tempFilePath))
{
File.Delete(tempFilePath);
}
});

}
}

Expand Down

0 comments on commit 1d3c5c1

Please sign in to comment.