Merge pull request #1310 from mcintyre94/CA-232963

[CA-232963] XC hangs after restarting toolstack while viewing PVS tab
This commit is contained in:
Mihaela Stoica 2016-11-24 17:17:33 +00:00 committed by GitHub
commit c437d10bc8

View File

@ -49,6 +49,8 @@ namespace XenAdmin.TabPages
private SelectionManager disableSelectionManager;
private DataGridViewVms_DefaultSort vmDefaultSort;
private readonly CollectionChangeEventHandler PvsProxy_CollectionChangedWithInvoke;
public PvsPage()
{
@ -61,7 +63,9 @@ namespace XenAdmin.TabPages
disableSelectionManager = new SelectionManager();
vmDefaultSort = new DataGridViewVms_DefaultSort();
PvsProxy_CollectionChangedWithInvoke = Program.ProgramInvokeHandler(PvsProxyCollectionChanged);
base.Text = Messages.PVS_TAB_TITLE;
}
@ -75,16 +79,16 @@ namespace XenAdmin.TabPages
{
if (connection != null)
{
connection.Cache.DeregisterCollectionChanged<PVS_proxy>(PvsProxyCollectionChanged);
connection.Cache.DeregisterCollectionChanged<VM>(PvsProxyCollectionChanged);
connection.Cache.DeregisterCollectionChanged<PVS_proxy>(PvsProxy_CollectionChangedWithInvoke);
connection.Cache.DeregisterCollectionChanged<VM>(PvsProxy_CollectionChangedWithInvoke);
}
connection = value;
if (connection != null)
{
connection.Cache.RegisterCollectionChanged<PVS_proxy>(PvsProxyCollectionChanged);
connection.Cache.RegisterCollectionChanged<VM>(PvsProxyCollectionChanged);
connection.Cache.RegisterCollectionChanged<PVS_proxy>(PvsProxy_CollectionChangedWithInvoke);
connection.Cache.RegisterCollectionChanged<VM>(PvsProxy_CollectionChangedWithInvoke);
}
LoadVMs();
@ -283,7 +287,7 @@ namespace XenAdmin.TabPages
private void PvsProxyCollectionChanged(object sender, CollectionChangeEventArgs e)
{
Program.Invoke(this, LoadVMs);
LoadVMs();
}
private void VmPropertyChanged(object sender, PropertyChangedEventArgs e)