Search Unity

Auto-disposing of native collections inside SharedComponentData?

Discussion in 'Entity Component System' started by Malmer, Apr 6, 2018.

  1. Malmer

    Malmer

    Joined:
    Nov 10, 2013
    Posts:
    18
    So SharedComponentData is ref-counted and will afaik automatically be nuked when nothing is referencing it anymore. But what about the containers inside? If a SharedComponentData has a NativeArray or a NativeHashmap. Will they be disposed too when the component is freed?
     
  2. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    546
    Well I don't know.

    But in the fact its a native container and they need to be allocated and deallocated manually... I would say no!