Skip to content

Commit 387388e

Browse files
author
Chris Jakeman
committed
Fix Activity Runner persists after loading exception
1 parent 07be044 commit 387388e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Source/RunActivity/Viewer3D/Processes/WebServerProcess.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ public WebServerProcess(Game game)
4343
{
4444
Game = game;
4545
Thread = new Thread(WebServerThread);
46+
47+
// Once the content has been loaded and the simulator is simulating, an exception will cause the web server process
48+
// to terminate itself.
49+
// However, an exception during loading will not terminate the web server process, so the application Open Rails Activity Runner
50+
// will persist until it is removed by the user.
51+
// A workaround to avoid this behaviour is to push the thread into the background.
52+
53+
// This thread is pushed into the background, so it will be terminated automatically when the main thread exits.
54+
Thread.IsBackground = true;
4655
}
4756

4857
public void Start()

0 commit comments

Comments
 (0)