子
子陵
Unregistered / Unconfirmed
GUEST, unregistred user!
用Form.Free和在onClose中设置action:=caFree的效果是否一样?<br>我查看了源码,前者调用了destroy,前者调用了release<br>窗体关闭时的事件调用顺序是:close,release,destory,对吗?<br>procedure TCustomForm.Release;<br>begin<br> PostMessage(Handle, CM_RELEASE, 0, 0);<br>end;<br><br>destructor TCustomForm.Destroy;<br>begin<br> if not (csDestroying in ComponentState) then GlobalNameSpace.BeginWrite;<br> try<br> if OldCreateOrder then DoDestroy;<br> MergeMenu(False);<br> if HandleAllocated then DestroyWindowHandle;<br> Screen.RemoveForm(Self);<br> FCanvas.Free;<br> FIcon.Free;<br> FreeAndNil(FActionLists);<br> inherited Destroy;<br> finally<br> GlobalNameSpace.EndWrite;<br> end;<br>end;<br>release和destroy有什么不同?<br><br>