Several independent forms appear in my application. Once upon creation, the application forgets about them. All actions are processed in this form. When the application closes the form closes as well, by RTS, I suppose. This is fine, except that neither OnClose nor the OnDestroy event fires, so a memory leak occurs. I can administer which forms are present (as it is now), but in fact the application should completely forget about these forms.
Is there a way to detect inside the form, which is not the main form of the application, that the application is in the process of closing?
source share