I have a component with a NativeHashSet as one of the variables. When I add the component with the ECB I use hs = new NativeHashSet<int>(0, Allocator.Persistent).
Later in the code I want to add things to the hash set and I think I need to dispose it when I destroy the entity.
I cannot figure out how to do that with the AddBuffer, SetComponent and Dispose methods of the ECB.
Can anyone tell me how to do that?