mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-12-03 16:41:04 +01:00
CA-236844: XenCenter throws "Assertion failed" error when toggling be… (#1419)
* CA-236844: XenCenter throws "Assertion failed" error when toggling between the RDP and VNC consoles Couldn't reproduce it, but it looks like the assertion is hit because the console view still holds a subscription to an event from an old vnc stream (maybe not garbage collected yet). Added code to deregister event handlers when the vcnStream is disconnected and also replaced the the assertion with an if statement, ignoring the case that might have caused the assertion failure. * CA-236844: XenCenter throws "Assertion failed" error when toggling between the RDP and VNC consoles Added a Debug assert and a null check. Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
parent
dbd60f1365
commit
ce8cdce0a4
@ -248,8 +248,11 @@ namespace XenAdmin.ConsoleView
|
||||
private void OnError(object sender, Exception e)
|
||||
{
|
||||
Program.AssertOffEventThread();
|
||||
System.Diagnostics.Trace.Assert(sender == this.vncStream);
|
||||
System.Diagnostics.Debug.Assert(sender == vncStream); // Please see to CA-236844 if this assertion fails
|
||||
|
||||
if (sender != vncStream)
|
||||
return;
|
||||
|
||||
this.connected = false;
|
||||
if (ErrorOccurred != null)
|
||||
ErrorOccurred(this, e);
|
||||
@ -262,6 +265,11 @@ namespace XenAdmin.ConsoleView
|
||||
{
|
||||
connected = false;
|
||||
terminated = true;
|
||||
if (vncStream != null)
|
||||
{
|
||||
vncStream.ErrorOccurred -= OnError;
|
||||
vncStream.ConnectionSuccess -= vncStream_ConnectionSuccess;
|
||||
}
|
||||
VNCStream s = vncStream;
|
||||
vncStream = null;
|
||||
if (s != null)
|
||||
|
Loading…
Reference in New Issue
Block a user