释放内存

sls 2000-02-27 05:12:00
各位有礼:

小弟初学DELPHI,近日碰到一问题。望各位高手不吝赐教:

form1.free;
form1.freeonrelease;
form1.release;

三种表达方式有何异同。

谢谢。

2000.2.27

我的MAIL地址:3255710@sina.com


...全文
194 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Lin 2000-02-27
  • 打赏
  • 举报
回复
从帮助文件中粘贴下来的:
Use Release to destroy the form and free its associated memory.
Release does not destroy the form until all event handlers of the form and event handlers of components on the form have finished executing. Any event handlers of the form should use Release instead of Free. Failing to do so could lead to an access violation.

Use Free to destroy an object. Free automatically calls the destructor if the object reference is not nil.Free is successful even if the object is nil.

FreeOnRelease is called when an interface implemented by the component is released. FreeOnRelease is used internally and calls the corresponding interface method. It should not be necessary to call FreeOnRelease directly.

5,385

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧