Fixed a crash when changing the testing engine on Linux. Fixes #1042

This commit is contained in:
biwa 2024-06-29 17:59:59 +02:00
parent 0fa3230157
commit c5ad8e75c6

View file

@ -24,6 +24,7 @@ using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows.Forms; using System.Windows.Forms;
@ -1575,7 +1576,15 @@ namespace CodeImp.DoomBuilder.Windows
// This updates the skills list // This updates the skills list
private void UpdateSkills() 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(); buttontest.DropDownItems.Clear();
// Map loaded? // Map loaded?