OwnerValueAttribute
Description
- Derived from
-
Attribute abstract
The OwnerValue is used on properties to declare ownership of disposable objects.
The following rules depict - based on the ownership status - when a disposable object must be disposed and when disposal must not be performed. Going by these rules will avoid situations where a resource is disposed although it is still being used and situations when a resource is never explicitly disposed, thus wasting system resources.
-
When used on a property:
... [OwnerValue] IDisposable MyObj { set { ... } } ... [OwnerValue] IDisposable MyObj { set { ... } get { ... } } ...
The property takes ownership on the object that is passed to it as the
value
, so the storage container from which the value has originated is no longer responsible for disposal.
- See also
Usages
CanvasWidget.Factory property
DataGrid.Model property
HeightmapPainter.Brush property
HttpFileSystem.Http property
IApplicationControl.Application property
IHeightmapProxy.Content property
ImageView.Image property
MapViewWidget.Pyramid property
MeshOptions.Heightmap property
ModelScanner.ModelReader property
SceneOptions.TerrainGeoid property
SceneOptions.TerrainHeightmap property
SceneViewWidget.Scene property
TerrainLayerRegion.Dataset property
TerrainViewWidget.Terrain property
TextureLayer.Content property
TextureWidget.Texture property
Thread.ThreadMain property