Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    DisposeBase Class

    Namespace: Stride.Core
    Assembly: Stride.Core.dll

    Base class for a System.IDisposable interface.

    System.Object → DisposeBase
    Derived from DisposeBase: ComponentBase ContentStorage EffectInstance EffectCompilerBase

    [DataContract]
    public abstract class DisposeBase : IDisposable, IReferencable
    Name Description
    Properties
    IsDisposed

    Has the component been disposed or not yet.

    Methods
    Destroy()

    Disposes of object resources.

    Dispose()
    OnAddReference()
    OnReleaseReference()
    Explicit Interface Implementations
    IReferencable.AddReference()

    Increments the reference count of this instance.

    IReferencable.ReferenceCount

    Gets the reference count of this instance.

    IReferencable.Release()

    Decrements the reference count of this instance.

    | Improve this Doc View Source

    Properties


    IsDisposed

    Has the component been disposed or not yet.

    public bool IsDisposed { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Methods


    Destroy()

    Disposes of object resources.

    protected virtual void Destroy()

    Dispose()

    public void Dispose()

    OnAddReference()

    protected virtual void OnAddReference()

    OnReleaseReference()

    protected virtual void OnReleaseReference()
    | Improve this Doc View Source

    Explicit Interface Implementations


    IReferencable.AddReference()

    Increments the reference count of this instance.

    int IReferencable.AddReference()
    Returns
    Type Description
    System.Int32

    The method returns the new reference count.


    IReferencable.ReferenceCount

    Gets the reference count of this instance.

    int IReferencable.ReferenceCount { get; }
    Returns
    Type Description
    System.Int32

    The reference count.


    IReferencable.Release()

    Decrements the reference count of this instance.

    int IReferencable.Release()
    Returns
    Type Description
    System.Int32

    The method returns the new reference count.

    Remarks

    When the reference count is going to 0, the component should release/dispose dependents objects.


    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.KeepReference<T>(T)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation