mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-25 06:16:37 +01:00
Prevent from crashing if cancelling the Import wizard while on the Select host page.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
parent
aca8be2939
commit
1050b14edc
@ -51,7 +51,7 @@ namespace XenAdmin.Wizards.ImportWizard
|
||||
{
|
||||
private IEnumerable<Host> m_hostTargets;
|
||||
private bool m_buttonNextEnabled;
|
||||
private List<SR> m_srsWithRegisteredEvents = new List<SR>();
|
||||
private readonly List<SR> m_srsWithRegisteredEvents = new List<SR>();
|
||||
private readonly CollectionChangeEventHandler PBD_CollectionChangedWithInvoke;
|
||||
|
||||
public ImportOptionsPage()
|
||||
@ -136,10 +136,13 @@ namespace XenAdmin.Wizards.ImportWizard
|
||||
|
||||
private void DeregisterEvents()
|
||||
{
|
||||
Connection.Cache.DeregisterCollectionChanged<PBD>(PBD_CollectionChangedWithInvoke);
|
||||
if (Connection != null)
|
||||
{
|
||||
Connection.Cache.DeregisterCollectionChanged<PBD>(PBD_CollectionChangedWithInvoke);
|
||||
|
||||
foreach (PBD pbd in Connection.Cache.PBDs)
|
||||
pbd.PropertyChanged -= server_PropertyChanged;
|
||||
foreach (PBD pbd in Connection.Cache.PBDs)
|
||||
pbd.PropertyChanged -= server_PropertyChanged;
|
||||
}
|
||||
|
||||
foreach (var sr in m_srsWithRegisteredEvents)
|
||||
sr.PropertyChanged -= server_PropertyChanged;
|
||||
|
Loading…
Reference in New Issue
Block a user