Fixed bug where the window disposed itself but was still referenced by the text editor

This commit is contained in:
Lukasz Baldyga committed 2020-10-21 16:14:00 +01:00
1 parent f91c90e878
commit 614e72434e
1 file changed
+1 -1
@@ -39,7 +39,7 @@ namespace Advanced_Software_Engineering {
} }
private void runToolStripMenuItem_Click(object sender, EventArgs e) { private void runToolStripMenuItem_Click(object sender, EventArgs e) {
if(DisplayForm == null) { if(DisplayForm == null || DisplayForm.IsDisposed) {
DisplayForm = new Draw_Preview(textBox1.Text); DisplayForm = new Draw_Preview(textBox1.Text);
} else { } else {
Console.WriteLine("Removed all commands"); Console.WriteLine("Removed all commands");