On 12/03/2015 09:26 PM, Krzysztof wrote:
How to destroy object or component in its own method
You can do a "pseudo-finalizer" method in an object that just ends by "Free;".
Here you (e.g. ion a thread) can create an object and queue that function via TThread.Queue, TThread.Synchronize, or Application.QueueAsyncCall. Now the object is automatically freed without you needing to bother about saving it (i.e. a pointer to same) in a variable.
(AFAIK implementing "real" finalizer methods - supposedly just syntax candy for exactly this) has already been discussed in the FPC developers message list)
-Michael -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
