don't call stop hook if we are not in the main thread anymore (likely caused by the exiting of the program)

This commit is contained in:
Evil Factory
2022-04-22 16:26:33 -03:00
parent e77ef4de26
commit e799eed64e

View File

@@ -338,7 +338,12 @@ namespace Barotrauma
}
foreach (var mod in ACsMod.LoadedMods.ToArray()) mod.Dispose();
ACsMod.LoadedMods.Clear();
Hook?.Call("stop");
if (Thread.CurrentThread == GameMain.MainThread)
{
Hook?.Call("stop");
}
Game?.Stop();