Disposable
Description
- Derived from
- Extended by
- 
ApplicationBase abstract 
 ApplicationControlBase abstract
 ApplicationLoop sealed
 ApplicationWindow abstract
 BlockIndexBase abstract
 BlockStorage sealed
 Brush abstract
 ByteBuffer sealed
 Canvas abstract
 CanvasContent sealed
 CanvasFactory abstract
 Component abstract
 CorrectionLayer sealed
 CsvReader sealed
 CsvWriter sealed
 DataCache abstract
 DataModelBase abstract
 DatasetCollection abstract
 DatasetFileCache sealed
 DataUpdaterList abstract
 Disposer sealed
 Event
 FileBase abstract
 FileSystem abstract
 GeodataPipeline sealed
 GeoPathReader abstract
 GeoPathReaderGeneric sealed
 Grammar sealed
 GrammarBuilder sealed
 Graph sealed
 Graphics sealed
 GraphicsContext abstract
 GraphicsFence abstract
 GraphicsTimer abstract
 Heightmap abstract
 HeightmapGrinder sealed
 HeightmapPainter sealed
 HeightmapProjector sealed
 ImageReaderBase abstract
 ImageWriter abstract
 MeshBuffer sealed
 MeshChunk sealed
 MeshChunkBuilder sealed
 MeshOptions sealed
 ModelInfo sealed
 ModelReader abstract
 ModelRenderer sealed
 ModelScanner sealed
 Monitor sealed
 NativeLibrary abstract
 NativeWindow sealed
 ObjectPoolBase abstract
 OpenFlightDatabase sealed
 Operation abstract
 ParserContext sealed
 ParticleBuffer sealed
 ParticleGeometry sealed
 PipelineStateStream sealed
 PixelPyramidGrinder sealed
 ProgressMonitor sealed
 PyramidBase abstract
 PyramidFileCache sealed
 RenderContext abstract
 RenderEffect abstract
 Renderer sealed
 RenderPipeline sealed
 RenderStageBase abstract
 ResourceBase abstract
 ResourceCache sealed
 ResourceData abstract
 ResourceLoader sealed
 RingBuffer sealed
 RootSignature sealed
 RunningOperation sealed
 Scene sealed
 SceneData abstract
 SceneObject abstract
 SceneOptions sealed
 SceneView sealed
 SerializableDisposableBase abstract
 ShapeReader abstract
 SimpleHttp abstract
 Sky sealed
 SkyDome sealed
 SocketContainer abstract
 SourceCodeWriter sealed
 SpriteCache sealed
 SpriteData sealed
 StreamBase abstract
 Streaming sealed
 StructuredBufferUpdater sealed
 TaskGroup sealed
 TaskPool sealed
 TerrainBuffer sealed
 TerrainLayer sealed
 TerrainLayerRegion sealed
 TerrainLayerSlot sealed
 TerrainLayerTexture sealed
 TerrainMesh sealed
 TerrainView sealed
 TexelBuffer abstract
 Thread sealed
 ThreadMainBase abstract
 Tutorial_GUI abstract
 VectorImage abstract
 VertexUpdater abstract
 VisualCache sealed
 Widget abstract
 WidgetDialogBuilder sealed
 WidgetGui sealed
Abstract implementation of the IDisposable interface.
A IDisposable object can hold references to the following types of resources:
- 
Owned: 
 References to IDisposable objects with Owner semantics.
 The references must be disposed in DisposeResources, in order to properly release ownership.
- 
Managed: 
 References to objects/arrays that are handled by the garbage collector resp. by smart pointers.
 These references should be cleared in DisposeResources, in order to help the underlying memory allocation system to perform efficiently.
- 
Unmanaged: 
 References to system resources that are not handled by the garbage collector resp. smart pointers.
 These references must be released properly in DisposeResources, to avoid memory leaks and dangling resources.
A class that provides the root method for initialization (which should be called Initialize) should use the following pattern (C#):
public virtual bool Initialize()
{
  if (!InitializeBegin())
    return false;
  // Your initialization code goes here.
  return true;
}
Derived classes should use this pattern (C#), to call the base initialization method:
public override bool Initialize()
{
  if (!base.Initialize())
    return false;
  // Your initialization code goes here.
  return true;
}
If for some reason, the base call to Initialize cannot be the first statement, use this pattern (C#):
public override bool Initialize()
{
  if (!InitializeRequired())
    return false;
  // Your initialization code goes here (first part).
  base.Initialize();
  // Your initialization code goes here (second part).
  return true;
}
Protected / Methods
DisposeResources
Disposes the resources held by a concrete subclass. This method will be called exactly once per instance.
This method will be called automatically as soon as all ownership references to this instance have been relinquished by calls to the IDisposable.Dispose method.
The system may garbage collect an instance of IDisposable iff there are no more references to it. In this case, the DisposeResources will be called, in order to avoid dangling resources. However, it is not advisable to rely on the garbage collection of the system, as the behaviour may differ significantly between environments. Instead, ownership rules should be obeyed, which effectively removes the need for automatic garbage collection.
Overriding methods must call the DisposeResources method of their base class. The base call should be the last statement. Other code should never call this method directly!