Interface INativeDisposable | Collections | 0.15.0-preview.21
docs.unity3d.com
    Show / Hide Table of Contents

    Interface INativeDisposable

    INativeDisposable provides a mechanism for scheduling release of unmanaged resources.

    Namespace: Unity.Collections
    Syntax
    public interface INativeDisposable : IDisposable

    Methods

    Dispose(JobHandle)

    Safely disposes of this container and deallocates its memory when the jobs that use it have completed.

    Declaration
    JobHandle Dispose(JobHandle inputDeps)
    Parameters
    Type Name Description
    JobHandle inputDeps

    The job handle or handles for any scheduled jobs that use this container.

    Returns
    Type Description
    JobHandle

    A new job handle containing the prior handles as well as the handle for the job that deletes the container.

    Remarks

    You can call this function dispose of the container immediately after scheduling the job. Pass the JobHandle returned by the Job.Schedule method using the jobHandle parameter so the job scheduler can dispose the container after all jobs using it have run.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023