1 \section{Object system implementation}
3 First, to get things clear, what are considered objects here are C
4 structures containing a properly initialized \type\indextype{WObj}
5 structure defined in \file{ioncore/obj.h} as the first element (or the
6 first element of the structure which is the first element and so on which
7 gives rise to inheritance). The \type{WObj} structure contains a pointer
8 to a \type{WObjDescr}\indextype{WObjDescr} class type info structure and
9 a list of so called ''watches''. The \type{WObjDescr} structure simply
10 lists the class name, a table of dynamic functions and a pointer to
11 deinitialisation function (or ''destructor'').
13 Ion does not do any reference counting, garbage collecting or other
14 fancy things related to automatic safe freeing of objects with its
15 simplistic object system. Instead special watches (the \type{WWatch}
16 \indextype{WWatch} structure) may be used to create safe references to
17 objects that might be destroyed during the time the specific pointer is
18 needed. When an object is destroyed, its list of watches is processed,
19 setting the pointers in the watches to NULL and the watch handlers for
20 each watch are called.