From c5ad8e75c665114cd4c6ae5730990cf65ec7c268 Mon Sep 17 00:00:00 2001 From: biwa <6475593+biwa@users.noreply.github.com> Date: Sat, 29 Jun 2024 17:59:59 +0200 Subject: [PATCH] Fixed a crash when changing the testing engine on Linux. Fixes #1042 --- Source/Core/Windows/MainForm.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/Core/Windows/MainForm.cs b/Source/Core/Windows/MainForm.cs index 7d2afb5e..2194d9bc 100755 --- a/Source/Core/Windows/MainForm.cs +++ b/Source/Core/Windows/MainForm.cs @@ -24,6 +24,7 @@ using System.Drawing; using System.Drawing.Imaging; using System.Globalization; using System.IO; +using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using System.Windows.Forms; @@ -1575,7 +1576,15 @@ namespace CodeImp.DoomBuilder.Windows // This updates the skills list private void UpdateSkills() { - // Clear list + // Clear list. Mono Winforms apparently tries to redraw the PlaceholderToolStripTextBox + // after it got removed, so let us manually dispose it, which seems to fix the probelm. + for (int i=0; i < buttontest.DropDownItems.Count; i++) + { + if (buttontest.DropDownItems[i] is PlaceholderToolStripTextBox item) + { + item.Dispose(); + } + } buttontest.DropDownItems.Clear(); // Map loaded?