"Jeff" <·······@gmail.com> wrote in message
··························@attbi_s01...
> As stated above, the mesh being GC'ed isn't a problem. We don't want it
> GC'ed. It stays on the ground being rendered with the rest of the scene
> until some later time when it is removed.
Even worse.
They're overloading the concept of the "destructor" from mere housekeeping
to application semantics. Wrong idiom.
Any concept of a finalizer in CLOS won't even approach this issue because
finalizer are fired (IF fired at all) asynchronously by the GC, and not
under control of the application.
C++ destructors, on the other hand, are used in a synchronous fashion. When
you free the object, the destructor happens in line with the rest of your
code.
So, when your friend does: delete obj;, the object falls flat on the ground
in a heap.
He really should make maintenance of semantic application state seperate
from maintenance of something like memory state.
So, ideally: obj->shotDead(); delete obj;
That idiom works in any language.
Regards,
Will Hartung
(·····@msoft.com)