OwnerThisAttribute
Description
- Derived from
-
Attribute abstract
The OwnerThis is used on instance methods 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 an instance method / extension method:
... [OwnerThis] void MyObj(...) { ... } ... [OwnerThis] void MyObj(this IDisposable obj, ...) { ... } ...
The instance method takes ownership of the object that is (implicitly passed) to it as
this
, so the storage container from which the value ofthis
has originated is no longer responsible for disposal.
- See also
Usages
ApplicationLoop.Run method
ByteBuffer.Compact method
ByteBuffer.ReadAsStream method
ByteBuffer.ToArrayOwn method
GrammarBuilder.Build method
GrammarBuilder.DefaultRule method
GrammarBuilder.ExternalRule method
GrammarBuilder.Psi method
Heightmap.DoSplit method
IBrush.Append method
IBrush.Average method
IBrush.Combine method
IBrush.Invert method
IBrush.MaskSlope method
IBrush.Merge method
IBrush.Modulate method
IBrush.OutputHeightmap method
IBrush.Prepend method
IDataStreamFactory.ToDataStream method
IDataStreamOps.Background method
IDataStreamOps.Buffer method
IDataStreamOps.ReadToEnd method
IDataStreamOps.ToFile method
IDisposable.Dispose method
IFileOps.Cache method
IFileOps.Offset method
IFileOps.ReadOnly method
IGeoPathReader.ReadAllArray method
IGeoPathReader.ReadAllCollect method
IGeoPathReader.ReadAllList method
IGeoPathReader.ReadAllPath method
IGeoPathReader.Vertical method
IHeightmapOps.Border method
IHeightmapOps.Clip method
IHeightmapOps.ColorChannels method
IHeightmapOps.Combine method
IHeightmapOps.Merge method
IHeightmapOps.Proxy method
IHeightmapOps.Scale method
IHeightmapOps.Split method
IHeightmapOps.Swizzle method
IHeightmapOps.ToPyramid method
IHeightmapOps.TransformRange method
IHeightmapOps.UseColorRamp method
IImageOps.Adjust method
IImageOps.AlphaToCoverage method
IImageOps.Background method
IImageOps.ChannelToIntensity method
IImageOps.Clip method
IImageOps.Crop method
IImageOps.Function method
IImageOps.IntensityToChannel1 method
IImageOps.IntensityToChannel2 method
IImageOps.Invert method
IImageOps.Op method
IImageOps.Pad method
IImageOps.Scale method
IImageOps.SetCoverage method
IImageOps.SetGamma method
IImageOps.SetGeoref method
IImageOps.SetLayer method
IImageOps.SetNoData method
IImageOps.SetRange method
IImageOps.SetValues method
IImageOps.Smooth method
IImageOps.ToCoverage method
IImageOps.WriteImage method
IImageReader.ReadAll method
IImageReader.ReadValuesAll method
IMapProjectionOperation.Datum method
IMapProjectionOperation.Projection method
IOperationOps.And method
IOperationOps.Then method
IPixelPyramid.Cache1 method
IPixelPyramid.Cache2 method
IPixelPyramid.ColorChannels method
IPixelPyramid.Slice method
IPixelPyramid.ToFullSize method
IPixelPyramid.ToTilePad method
IPixelPyramid.ToTileSize method
IProjectSamplesOperation.Since method
ISceneDataBuilder.Build method
IShapeReader.Modifier method
ITexelPyramid.Cache method
ITexelPyramid.DecodePixels method
ITextStream.ReadToEnd method
ITextStreamFactory.ToTextStream method
MeshChunkBuilder.BuildAndDispose method
PipelineStateStream.Build method
PixelFont.Monospaced method
SceneOptions.CreateScene method
TexelBuffer.Convert1 method
TexelBuffer.Convert2 method
TexelBuffer.Convert3 method
TexelBuffer.ToColorBufferOwn method
TinmanErrorDump.Save method
WidgetDialogBuilder.Build method
WidgetDialogBuilder.Button method
WidgetDialogBuilder.ButtonCancel method
WidgetDialogBuilder.ButtonNo method
WidgetDialogBuilder.ButtonOk method
WidgetDialogBuilder.ButtonYes method
WidgetDialogBuilder.Content1 method
WidgetDialogBuilder.Content2 method
WidgetDialogBuilder.Content3 method
WidgetDialogBuilder.EventDelegate method
WidgetDialogBuilder.EventListener method
WidgetDialogBuilder.Show method
WidgetDialogBuilder.Title method
WidgetDialogBuilder.UserData method