From 8262c6528ff06a2f09b75c3c47b1453529344144 Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Mon, 5 Sep 2022 21:40:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 不销毁根节点 --- funcext/tvclib/tslvcl.tsf | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/funcext/tvclib/tslvcl.tsf b/funcext/tvclib/tslvcl.tsf index 9a2fd35..9329b9b 100644 --- a/funcext/tvclib/tslvcl.tsf +++ b/funcext/tvclib/tslvcl.tsf @@ -527,6 +527,14 @@ type tapplication=class(tcomponent) CreateHandle(); FApplicationWindow.bindmessage(WM_ACTIVATEAPP,thisfunction(WMACTIVATEAPP)); end + function Notification(a,op);override; + begin + inherited; + if a=Fmainform and op="recycling" then + begin + Fmainform := nil; + end + end function createform(classname,varable); begin {** @@ -537,7 +545,8 @@ type tapplication=class(tcomponent) if paramcount<2 then exit; // if classname is class(tcomponent)then begin - if not(FApplicationWindow)then initialize(); + //if not(FApplicationWindow)then + initialize(); varable := createobject(classname,FApplicationWindow); if varable is class(TVCForm)then begin @@ -4942,7 +4951,8 @@ type tapplicationwindow=class(TWinControl) end Function DoWMCLOSE(o,e);override; begin - Recycling(); + //Recycling(); + DestroyComponents(); _wapi.PostQuitMessage(0); end function DoCnNotify(o,e);override;