From d8d03916ea1db0c572b605b0192078523069cef5 Mon Sep 17 00:00:00 2001 From: biwa <6475593+biwa@users.noreply.github.com> Date: Wed, 23 Dec 2020 16:43:59 +0100 Subject: [PATCH] Added safeguard against crashes related to config disposing. Fixes 251. Fixes 352. Fixes 514. --- Source/Core/Config/ConfigurationInfo.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Source/Core/Config/ConfigurationInfo.cs b/Source/Core/Config/ConfigurationInfo.cs index de542b82..7a167235 100755 --- a/Source/Core/Config/ConfigurationInfo.cs +++ b/Source/Core/Config/ConfigurationInfo.cs @@ -232,8 +232,13 @@ namespace CodeImp.DoomBuilder.Config //mxd. Destructor ~ConfigurationInfo() { - if (thingsfilters != null) foreach(ThingsFilter tf in thingsfilters) tf.Dispose(); - if (testEngines != null) foreach(EngineInfo ei in testEngines) ei.Dispose(); + // biwa. There have been crash reports because of null references + // https://github.com/jewalky/UltimateDoomBuilder/issues/251 + // https://github.com/jewalky/UltimateDoomBuilder/issues/352 + // https://github.com/jewalky/UltimateDoomBuilder/issues/514 + // Can't reproduce, but add a safeguard anyway. + if (thingsfilters != null) foreach(ThingsFilter tf in thingsfilters) if(tf != null) tf.Dispose(); + if (testEngines != null) foreach(EngineInfo ei in testEngines) if(ei != null) ei.Dispose(); } #endregion