diff --git a/XenAdmin/Dialogs/AddServerDialog.Designer.cs b/XenAdmin/Dialogs/AddServerDialog.Designer.cs index a2a35590e..2a898dd2c 100644 --- a/XenAdmin/Dialogs/AddServerDialog.Designer.cs +++ b/XenAdmin/Dialogs/AddServerDialog.Designer.cs @@ -186,6 +186,7 @@ namespace XenAdmin.Dialogs this.CancelButton = this.CancelButton2; this.Controls.Add(this.tableLayoutPanelType); this.Name = "AddServerDialog"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AddServerDialog_FormClosing); this.Load += new System.EventHandler(this.AddServerDialog_Load); this.Shown += new System.EventHandler(this.AddServerDialog_Shown); this.groupBox1.ResumeLayout(false); diff --git a/XenAdmin/Dialogs/AddServerDialog.cs b/XenAdmin/Dialogs/AddServerDialog.cs index a172385bf..284e9120b 100644 --- a/XenAdmin/Dialogs/AddServerDialog.cs +++ b/XenAdmin/Dialogs/AddServerDialog.cs @@ -337,6 +337,12 @@ namespace XenAdmin.Dialogs { pictureBoxError.Visible = labelError.Visible = (labelError.Text != ""); } + + private void AddServerDialog_FormClosing(object sender, FormClosingEventArgs e) + { + if (connection != null) + XenConnectionUI.connectionDialogs.Remove(connection); + } } public class CachePopulatedEventArgs : EventArgs