#Got "ICD not been added to the entity" on the supposed-to-be-destroyed entity

1 messages · Page 1 of 1 (latest)

native loom
#

I have written everything about the exception in the following Gist: Gist link

Thanks for reading!

Gist

GitHub Gist: instantly share code, notes, and snippets.

wise notch
#

bool targetIsValid = state.EntityManager.Exists(harvestEntity);

#

is actually not a safe check for this

#

if you have state components when it's destroyed it might have all its components stripped

#

but the entity will still exist

#

honestly Exists is never really 'safe' to use, just check if it has the component

native loom
native loom
wise notch
#

sorry i meant cleanup component

#

a common case you might run into is the Child buffer

native loom
vernal maple
#

@native loom you don't have to manually dispose Allocator.Temp.

#

Each frame, the main thread creates a Temp allocator which it deallocates in its entirety at the end of the frame.

Each job also creates one Temp allocator per thread, and deallocates them in their entirety at the end of the job.

Because a Temp allocator gets discarded as a whole, you don't need to manually deallocate Temp allocations, and doing so does nothing.

#

Manual disposal is only mandate for Allocator.Persistent or some custom allocators.

native loom