In libcschem, it is safe to reference concrete objects by pointers, because
of the undo system.

Every concrete object is also part of a doubly linked list. This list is
one of the sheet's 'active' or 'deleted' lists. This is true for all
objects in both the direct and the indirect subtrees.

Existing objects are part of the 'active' list. Once they are deleted, they
are moved to the 'deleted' list by the 'redo' operation of the deletion and
if it is undone, the 'undo' operation will move the object back from the
'deleted' list to the 'active' list.

Order of objects on these two lists does not matter. The lists are there
for only one purpose: to make sure no object is lost.

This also means that once an object is created, it is never freed until
the whole sheet is freed. It may change its state from active to deleted
or back, but the address of the object is preserved.

Furthermore each concrete object is part of exactly one sheet. A paste buffer
is a sheet too. When an object travels between sheets, the object needs to
be copied. The 'deleted' list of a sheet used as a paste buffer is always
empty: buffers are not edited, they are created and destroyed and re-created
from real sheets.


Conclusion: this makes referencing by pointer safe, even without having
to use a reference counter:

- a concret object is always within a sheet
- it is created once, and will never be deleted until the whole sheet is deleted
- the address of the object is immutable
