-
-
Notifications
You must be signed in to change notification settings - Fork 80
Closed
Description
The problem
Calling dispose twice on DisposableTimer raises a exception. According to microsoft documentation a dispose implementation should allow this: https://learn.microsoft.com/en-us/dotnet/api/system.idisposable.dispose?redirectedfrom=MSDN&view=net-7.0#System_IDisposable_Dispose
Environment
- NetDaemon release with the issue: JoySoftware.NetDaemon.Extensions.Scheduling 22.44.0
- Last working NetDaemon release (if known):
- Operating environment (Home assistant Add-on/Docker/Dev setup): Dev setup
- Link to integration documentation on our website:
Link to or paste code that causes the issue
var timer = new DisposableTimer(CancellationToken.None);
timer.Dispose();
timer.Dispose();Traceback/Error logs
System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at System.Threading.CancellationTokenSource.Cancel()
at NetDaemon.Extensions.Scheduler.DisposableTimer.Dispose()Additional information
Metadata
Metadata
Assignees
Labels
No labels