Click or drag to resize
AB4D logo

DisposeList Class

DisposeList contains a list of IDisposable objects that are automatically disposed when DisposeList is disposed. The order of disposal is reversed from the order in which the objects were added to the list (first object is disposed last).
Inheritance Hierarchy
SystemObject
  Ab3d.DirectXDisposeList

Namespace: Ab3d.DirectX
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.0.8865.1045
Syntax
C#
public sealed class DisposeList : IDisposable

The DisposeList type exposes the following members.

Constructors
 NameDescription
Public methodDisposeListInitializes a new instance of the DisposeList class
Top
Methods
 NameDescription
Public methodAdd Adds object to this DisposeList
Public methodDispose Disposes all objects in this DisposeList
Public methodRemove Removes object from this DisposeList
Top
Remarks

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.

See Also