Dispose of timer when creating new port polling Timer

This avoids having too many timers running at the same time.

One could for instance update the `EnableRDPPolling` property from the `Options` dialog and start several concurrent `Timer`s

Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
This commit is contained in:
Danilo Del Busso 2023-07-12 09:22:00 +01:00
parent 84e294b4b7
commit 60a5580d20
No known key found for this signature in database

View File

@ -772,6 +772,8 @@ namespace XenAdmin.ConsoleView
if (Source == null || Source.IsControlDomainZero(out _))
return;
_connectionPoller?.Dispose();
//Start the polling again
_connectionPoller = !Source.IsHVM()
? new Timer(PollVNCPort, null, RETRY_SLEEP_TIME, RDP_POLL_INTERVAL)