Form disposal on client disconnection

Added disposal method to dispose of all userstate forms for client upon
disconnection of the client from the server
This commit is contained in:
d3agle 2015-04-04 16:48:47 -05:00
parent 5d20aad9d6
commit 9058ec53cc
2 changed files with 20 additions and 0 deletions

View File

@ -264,6 +264,8 @@ namespace xServer.Core
{
_clients.Remove(s);
OnClientState(s, false);
s.Value.DisposeForms();
}
}
}

View File

@ -37,5 +37,23 @@ namespace xServer.Core
LastDesktopSeen = true;
LastDirectorySeen = true;
}
public void DisposeForms()
{
if (FrmRdp != null)
FrmRdp.Close();
if (FrmTm != null)
FrmTm.Close();
if (FrmFm != null)
FrmFm.Close();
if (FrmSi != null)
FrmSi.Close();
if (FrmSm != null)
FrmSm.Close();
if (FrmRs != null)
FrmRs.Close();
if (FrmStm != null)
FrmStm.Close();
}
}
}