This project has moved. For the latest updates, please go here.

Do I need to dispose all the instances (Task, Trigger, Action, etc) which implemented interface “IDisposable”?

Topics: Examples
Apr 5, 2016 at 11:31 AM
on the Example Home page:

I see that only the TaskService need to be disposed.
But others classes, for example: Task, TaskDefinition, Trigger, Action, etc. They implemented interface “IDisposable” too.
Do I need to call method “IDisposable .Dispose” (or user “useing”) to release resource?

Thank you very much for your help!
Apr 7, 2016 at 2:44 PM
No. Those are created and disposed internally. Technically, due to the beauty of garbage disposal in C#, you don't need to manually dispose of anything. However, if you are worried about memory consumption while running your app, disposing the TaskService instance should clean up all memory previously used by the library.
Marked as answer by dahall on 4/7/2016 at 6:44 AM