Thank you very much wp for this very helpful informations.
I did not know the TCustomForm.
Release() method before, but found a remarkable detailed documentation in
https://lazarus-ccr.sourceforge.io/docs/lcl/forms/tcustomform.release.html Normally TCustomForm.Release() calls Application.
ReleaseComponent(self), which is (also remarkable detailed) documentated in
https://lazarus-ccr.sourceforge.io/docs/lcl/forms/tapplication.releasecomponent.html Normally Application.ReleaseComponent() adds the given Component to an "internal list" and posts an "asynchronous application message" via TApplication.
QueueAsyncCall(TApplication.
FreeComponent).
TApplication.FreeComponent() calls TApplication.
ReleaseComponents(), which in general calls
Free() for all Components in above "internal list" - which answers my question a)
TApplication.
QueueAsyncCall() inserts an asynchronous call into a queue, for whose execution time I found a couple of related wordings e.g.:
1) which is handled when the application is idle
2) for execution in the main event loop, when all other events have been processed
3) to be executed, after the current event has finished
4) to be executed, after all other messages have been processed.
This execution time is still somewhat nebulous for me...
- does all 4 wordings mean exactly the same?
- is here an "event" exactly the same as a "message"? (I know nothing about "Windows messages")
- 2) and 3) differ regarding "all other events" and "the current event". Which is correct?
It would be great, if you (or someone else) could spend some more light on this execution time. Thanks a lot.