When we write managed code, we are always relying on the GC to clean up the managed objects we create and use (whether they implement IDisposable or not), and we do not need to be concerned with deallocating those objects or the memory they consume, calling d'tors, etc.
The comment on GC from the master is inaccurate.
Actually, GC only frees the resources that have reached the zero count. objects implementing IDisposable have to release their own resources and even then when they are released (through Dispose meth) only the ref count is descresed on that reference and ultimately the GC that actually frees the resources.
the Test2 in the code you cited uses Erase method to mark it, not releasing the resource. when Circle was created with the new operator its ref count would have been bumped up and everytime it is on the right side of the assignment operator.
what is not clear to me is whether the transaction object adds ref count or not when the Add() meth is called and does it release the ref count for Erase() marked objects. in C++ when a COM interface passed to a func a ref is added?
One way to find that out is by allocating a large number of objects and then testing with diag tools.