Objects are managed by our mark-and-sweep collector, but are anchored against garbage collection so long as their reference count is nonzero.
Object and member destructors will not be called on destruction unless a subclass also inherits from Inkscape::GC::Finalized.
New instances of anchored objects should be created using the C++ new operator. Under normal circumstances they should not be created on the stack.
A newly created anchored object begins with a refcount of one, and will not be collected unless the refcount is zero.
NOTE: If you create an object yourself, it is already anchored for you. You do not need to anchor it a second time.
Note that a cycle involving an anchored object (with nonzero refcount) cannot be collected. To avoid this, don't increment refcounts for pointers between two GC-managed objects.
Public Member Functions
|unsigned||_anchored_refcount () const|
|void||anchor () const|
|void||release () const|
Private Member Functions
|void||_free_anchor (Anchor *anchor) const|
|Anchor *||_new_anchor () const|
|Anchored (Anchored const &)|
|void||operator= (Anchored const &)|