I'm using AllocatorHelper<RewindableAllocator> in a monobehaviour that has [ExecuteAlways]
It's created in the Awake and destroyed in the OnDestroy. However, when I reload scripts, the allocator is destroyed (the ptr inside the struct becomes null), yet the OnDestroy has not been called. A custom boolean bAllocatorCreated that's in sync with my code remains true.
Beyond the fact that the allocator may be destroyed by the system on compilation, how is it possible that the pointer inside the AllocatorHelper<RewindableAllocator> struct becomes null? It's not a class and not modified by anyone else.
What's the right way to go about using allocators in this way?