Unstable 0.15.22.0

This commit is contained in:
Markus Isberg
2021-12-17 00:19:56 +09:00
parent 7d43cb1e91
commit a864a98d4f
16 changed files with 78 additions and 33 deletions
@@ -203,12 +203,26 @@ namespace Barotrauma
private readonly Action? onQuit;
private void OnQuit()
{
if (assembly != null) { onQuit?.Invoke(); }
try
{
if (assembly != null) { onQuit?.Invoke(); }
}
catch (Exception e)
{
e = e.GetInnermost();
DebugConsole.AddWarning($"Failed to call GameAnalytics.OnQuit: {e.Message} {e.StackTrace}");
//If this happens then GameAnalytics is just broken,
//let's just hope that it uninitialized correctly and
//allow the game to keep running
}
}
public void Dispose()
{
if (loadContext is null) { return; }
OnQuit();
loadContext?.Unload();
loadContext = null;