----- Original Message -----
From: "S0 F1" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, August 02, 2008 9:11 AM
Subject: [Flashcoders] AS3 Destructors and Garbage Collection ...
What is the point of a class (one that is instantiated and used via
composition within another class) having a destructor?
Cleaning up a class can be involved, so destructors can be usefull to allow
the developer to control that cleanup (maybe even propogate events). BUT
there are no destructors in AS3..
Shouldn't the class that composites the other class (let's say a parent
class compositing a sub class) just be able to remove all references to
sub
class and then it will be garbage collected (making sure nowhere else in
the
application makes reference to the sub class).
The class that is trying to remove the composite instance may not be aware
of other references to the class and have no way to find them.
And further more, why is there no way to flag an object for garbage
collection and then force the garbage collector to dispose of the class?
It's a dangerous business removing instances when there are still references
to them. Check out as3 weak references.
Any thoughts on this?
A really controversial subject for AS3 already discussed at great length on
flexcoders. I think you've opened the floodgates here, too.
Paul
Thanks.
S0 F1.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders