Comparing Pointers
 
 
 

It is not possible to compare wrapper pointers to see if the wrapper objects are the same. Any number of different wrapper objects may reference the same Alias data internally. It is necessary to use AlAreEqual() to compare objects. This will compare the Alias objects to which the wrappers point. It is a true test of equality between Alias objects.

In addition, checking a pointer for NULL is not sufficient for determining its validity. It is possible that through interaction with Alias, a developer may delete an object, causing any associated wrappers to become invalid, lest they point to freed memory. AlIsValid() should be used on wrappers that may have become invalidated since they were last referenced. All classes implicitly perform validity checks on instances, so a member function called on an invalid object will simply fail.