Application.mainform is nil, so even if mainform doesn't exist, the application still exists, but it's not visible. The application itself is also a window, but its size is 0. So there's only another way to close the application (Ctrl+alt+del or press CTRL+F2 in the Delphi IDE). Tip: Try not to close the form with the free method, especially the main form, and you should use the Close method. In Formcre
When you have finished using the object, you should undo it in time to free up the memory that this object occupies. You can revoke your object by invoking a logout method, which frees the memory allocated to the object.There are two ways to unregister Delphi: Destroy and free. Delphi recommends using
[Switch] Some experiences on resource release (Free/release/freeandnil) in Delphi
After studying free and release in Delphi during this period, we will summarize the following:1. After the form. Free directly releases the resource, the ondestroy event is called, but the for
According to the daily programming experience, we can get some experience about the release of resources in Delphi.
If there is an object obj is a tobject type:
1 Obj.free The resource directly, the OnDestroy event is invoked, but the OBJ pointer value is not placed as nil.
2) Obj.release wait for resources to release resources after they are no longer in use, and also do not modify OBJ pointers to nil, so it is best to use release for resource dea
After studying free and release in Delphi during this period, we will summarize the following:1. After the form. Free directly releases the resource, the ondestroy event is called, but the form pointer is not changed to nil.2. Form. Release: Release the resource after the resource is no longer used. Also, the form pointer is not modified to nil. Therefore, it is
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.