From 88a76f0c9f96990d85ebdb612085d2a606cedbc4 Mon Sep 17 00:00:00 2001 From: Regalis Date: Fri, 3 Mar 2017 20:58:32 +0200 Subject: [PATCH] Fixed the game process staying active in the background after a crash (due to a running sound streaming thread) --- Subsurface/Source/Sounds/OggStream.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Subsurface/Source/Sounds/OggStream.cs b/Subsurface/Source/Sounds/OggStream.cs index cc02e522f..c2a3cb18e 100644 --- a/Subsurface/Source/Sounds/OggStream.cs +++ b/Subsurface/Source/Sounds/OggStream.cs @@ -381,6 +381,10 @@ namespace Barotrauma.Sounds Instance = this; underlyingThread = new Thread(EnsureBuffersFilled) { Priority = ThreadPriority.Lowest }; + + //background threads are automatically stopped when all foreground threads have been stopped + // -> the streaming thread won't stay running in the background if the main thread crashes + underlyingThread.IsBackground = true; underlyingThread.Start(); }