Hey All, This weekend i put together a simple shooter and ran into a strange problem in MiniB3D.
Very intermittently ( perhaps 1 in 100 times) when calling FreeEntity, the game would crash while attempting to access a null object.
I narrowed this down to the line that uses the link to remove the entity from the list of all entities. I fixed the crash by removing the object from the list rather than using the link.
For example, this works
TEntity.entity_list.Remove (Self.Mesh)
but this creates the intermittent crash
Self.Mesh.Link.Remove()
Does anybody know the difference between the two?
It is possible that I'm calling this twice on an object, would Link.Remove crash but List.Remove work if the object was already removed from the list?
Very intermittently ( perhaps 1 in 100 times) when calling FreeEntity, the game would crash while attempting to access a null object.
I narrowed this down to the line that uses the link to remove the entity from the list of all entities. I fixed the crash by removing the object from the list rather than using the link.
For example, this works
TEntity.entity_list.Remove (Self.Mesh)
but this creates the intermittent crash
Self.Mesh.Link.Remove()
Does anybody know the difference between the two?
It is possible that I'm calling this twice on an object, would Link.Remove crash but List.Remove work if the object was already removed from the list?