| Did you know ... | Search Documentation: |
| object->done |
..... get(Area, size, Size), .... send(Size, done).
The receiving object will be deleted from the object base as with object->free
if the receiver has no object<-references, object<-lock_object
is @off and
object<-protect
is @off.
In the example above object->done
is equivalent to object->free
as the size object
returned by area<-size
is created by this method (provided the .... computation does not lock,
protect or make the size an attribute of some other object. In the
example below, using object->free
will corrupt PCE's database:
.... get(Graphical, area, Area), .... free(Area). % ==> ERROR!!!
The area object will
be deleted and the slot graphical<-area
will be pointing in the dark (checkpce/0
will find such problems).
Using object->done
is often not necessary. After a user-event has been processed all
unreferenced and unlocked objects will be deleted from the object base
automatically. Unreferenced objects created during the execution of a
user-defined method for a PCE class are also deleted automatically. object->done
is useful when a lot of garbage objects are created in a loop.
<-lock_object