A "class" already is a reference (read: pointer).Originally Posted by JSoftware
The trick if multiple classes have references to the same class is to think (and document/annotate) clearly which class "owns" the object for e.g. freeing purposes.
So if X,Y,Z both reference A, we specify that e.g. X also OWNS A, so when X gets destroyed, in its destructor it free's A.
Bookmarks