Programming in XPCE/Prolog: Section E.2

## E.2 Practical considerations

The principal predicates new/2, send/[2-12] and get/[3-13] will destroy all argument- and answer- objects created during their execution except for the object created by new/2 and the object returned by get/[3-13].

An object created by new/2 with an integer (anonymous) object reference must either be attached to another object, locked against PCE's garbage collector or destroyed using `object`->`done' if it is created during the initialisation of the application or in a loop that is passed many times. Such objects will be automatically reclaimed if (1) the object is created while handling a user-event after handling the event is finished or (2) the object is created in the implementation of a method on a user-defined class and the method terminates execution.

If is is not known whether or not the result of get/[3-13] is a computed object the user should invoke `object`->`done' to this result when the result is no longer needed. This will free the result if it was a computed (and no longer referenced) object and has no effect otherwise. If the result of the get operation is known to be an integer, no such message should be send.