Re: [Lazarus] How to destroy object / component by itself?

2015-12-04 Thread Michael Schnell
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

[Lazarus] How to destroy object / component by itself?

2015-12-03 Thread Krzysztof
Hi, How to destroy object or component in its own method (do this in next message queue)? Currently I'm using Application.QueueAsyncCall but IIRC there is special routine in FPC/LCL but can't find. For example Qt has myobject.qDeleteLater() Regards --

Re: [Lazarus] How to destroy object / component by itself?

2015-12-03 Thread Marc Weustink
On December 3, 2015 9:26:39 PM GMT+01:00, Krzysztof wrote: >Hi, > >How to destroy object or component in its own method (do this in next >message queue)? Currently I'm using Application.QueueAsyncCall but IIRC >there is special routine in FPC/LCL but can't find. For example Qt has

Re: [Lazarus] How to destroy object / component by itself?

2015-12-03 Thread Anthony Walter
procedure TForm1.FormCreate(Sender: TObject); begin FRecycleBin := TObjectList.Create(True); end; procedure TForm1.FormDestroy(Sender: TObject); begin FRecycleBin.Free; end; procedure TForm1.ApplicationProperties1Idle(Sender: TObject; var Done: Boolean); begin FRecycleBin.Clear; Done :=

Re: [Lazarus] How to destroy object / component by itself?

2015-12-03 Thread Bart
On 12/3/15, Krzysztof wrote: > How to destroy object or component in its own method (do this in next > message queue)? Currently I'm using Application.QueueAsyncCall but IIRC > there is special routine in FPC/LCL but can't find. For example Qt has > myobject.qDeleteLater()