I realize that there's no new type being created. I'm just curious about how this nullifying of copied pointers to deleted instances works, as I can see some interesting uses for it for dynamic garbage collection if this behaviour is consistant.
What I'd like to do basically is to be able to assign an effect to an entity. The effect has its details stored in a type object. The entity also has a type object associated with it which stores its details, and there is a function which deletes both the entity and its associated type object. The effect (rotation, for example) is updated in a For-Each-Next loop.
The problem is that the entity might be deleted by circumstances outside the effect update, in which case the code that updates the effect will end up trying to work with an entity that no longer exists. If I store a type pointer that points to the entity's associated type object, in the effect's type object, then when the effect is updated I can simply check if that pointer has suddenly become null and then delete the effect's type object to avoid a conflict.
What I'd like to do basically is to be able to assign an effect to an entity. The effect has its details stored in a type object. The entity also has a type object associated with it which stores its details, and there is a function which deletes both the entity and its associated type object. The effect (rotation, for example) is updated in a For-Each-Next loop.
The problem is that the entity might be deleted by circumstances outside the effect update, in which case the code that updates the effect will end up trying to work with an entity that no longer exists. If I store a type pointer that points to the entity's associated type object, in the effect's type object, then when the effect is updated I can simply check if that pointer has suddenly become null and then delete the effect's type object to avoid a conflict.