Search Unity

Bug Can't create dispose job for NativeArray in Burst

Discussion in 'Entity Component System' started by HyperionSniper, Jan 2, 2023.

  1. HyperionSniper

    HyperionSniper

    Joined:
    Jun 18, 2017
    Posts:
    30
    Burst throws an exception at runtime when scheduling a dispose job using NativeArray.Dispose(inputDeps).

    InvalidOperationException: System.InvalidOperationException: Reflection data was not set up by an Initialize() call.
    Support for burst compiled calls to Schedule depends on the Collections package.


    Apparently, the dispose job doesn't have reflection data set up for Burst calls. Unfortunately I can't manually register the job, since it's an internal class.
    I couldn't find any useful information on this anywhere. Does anyone have a solution?

    (P.S. It just occurred to me that I posted this on the wrong subforum. I've reposted this on the Burst sub.)
     
    Last edited: Jan 2, 2023
  2. Rukhanka

    Rukhanka

    Joined:
    Dec 14, 2022
    Posts:
    204
    Use deprecated [DeallocateOnJobCompletion] for NativeArrays for now