In some disposable classes for c# there is documentation note:
Always call Dispose before you release your last reference to the XXXX. Otherwise, the resources it is using will not be freed until the garbage collector calls the XXXX object's Finalize method.
Where XXXX is for instance the SemaphoreSlim or the ManualResetEventSlim. What I understand from this Note is that if you do not call dispose (Otherwise) the resources XXXX is using (including unmanaged objects) will be freed eventually by the GC.
Is my understanding correct? Because if it is it implies that at least for these classes, there is no real need to actually call the Dispose() on them.
1.4m articles
1.4m replys
5 comments
56.9k users