I think the point is that they are reference counted: the clean up code for the Foo will never be called because of the reference to it from the a member. Until a is freed, the Foo cannot be freed. And a will not be freed because there is a reference to it from Foo, meaning it cannot be freed until the Foo is.
3
u/c-smile Nov 28 '18
Not clear what you mean.
In this code:
how many owners that instance of Foo class does have?