Dispose |
public sealed class DisposeList : IDisposable
The DisposeList type exposes the following members.
Name | Description | |
---|---|---|
DisposeList | Initializes a new instance of the DisposeList class |
Name | Description | |
---|---|---|
Add | Adds object to this DisposeList | |
Dispose | Disposes all objects in this DisposeList | |
Remove | Removes object from this DisposeList |
NOTE:
We do not check if the objectToDispose is already in the _disposables list
This check is quite expensive - we need to go throug the whole list each time.
Therefore the objects that are added to DisposeList must check if they are already disposed and should not dispose themself more than once.