Deletion
 
 
 

Be very careful when deleting objects from the universe.

Some complex objects are closely linked and behave as a single entity. This includes objects such as camera nodes and camera objects.When a member of the group is deleted, the other members will also be deleted.

For example, when one of the three camera nodes is deleted, the other two nodes will also be deleted. Alternatively, if a camera node is deleted, its camera (and other camera nodes) are deleted. Since the camera nodes are often siblings, developers should be careful that they are not left with a pointer that refers to a deleted object.

An advantage to wrappers is that they can be invalidated, meaning that the internal object they reference may be deleted, but the wrapper remains with the knowledge that it is not valid. Methods of an invalid wrapper will fail gracefully, avoiding dereferencing dangling pointers.