In “FTickableGameObject::TickObjects”, it checks “If the new tickable object has already been deleted.”
The check is done by comparing the memory address of the object.
The problem is, if an object is destroyed and added to the DeletedTickableObjects, and a new object is created and happens to have the same memory address as the destroyed object, this newly created object is considered to be deleted and is not added to the tickable objects list.
Is this a bug of the engine?
Or this shouldn’t happen as a new object should never be created between a garbage collection and TickObjects call?
Is the engine assuming that you can only call in the below order?
1: create new tickable object
2: garbage collection
3: FTickableGameObject::TickObject
void FTickableGameObject::TickObjects(UWorld* World, const int32 InTickType, const bool bIsPaused, const float DeltaSeconds)
…
// If the new tickable object has already been deleted, don't add it to the tickable objects list
if (!Statics.DeletedTickableObjects.Contains(NewTickableObject))
{
AddTickableObject(Statics.TickableObjects, NewTickableObject);
}