|
From: Andreas H. <ah...@us...> - 2004-12-28 13:47:13
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10448/run Modified Files: JvAppInst.pas Log Message: Fixed Mantis #2439: JvAppInstances sets "Application" to nil Index: JvAppInst.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvAppInst.pas,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** JvAppInst.pas 1 Sep 2004 15:06:31 -0000 1.22 --- JvAppInst.pas 28 Dec 2004 13:46:53 -0000 1.23 *************** *** 175,191 **** AppInstances.SendCmdLineParams(sAppInstancesWindowClassName, Handle); ! // terminate this process (Form.OnCreate is not executed yet) - {$IFDEF VCL} { DoneApplication destroys all formulars in the Forms unit's finalization section. At that moment the OnDestroy events are fired. ! To prevent this we set the Application variable to nil. Because ! KillInstance uses halt() to terminate this does not raise any access ! violation. } ! Application := nil; ! {$ENDIF VCL} ! {$IFDEF VisualCLX} ! FreeAndNil(TPrivateComponent(Application).FComponents); ! {$ENDIF VisualCLX} AppInstances.KillInstance; end; --- 175,190 ---- AppInstances.SendCmdLineParams(sAppInstancesWindowClassName, Handle); ! // terminate this process (Form.OnCreate is not executed yet) { DoneApplication destroys all formulars in the Forms unit's finalization section. At that moment the OnDestroy events are fired. ! To prevent this we set the OnDestroy event of the Owner to nil. } ! if Owner <> nil then ! begin ! if Owner is TForm then ! TForm(Owner).OnDestroy := nil ! else if Owner is TDataModule then ! TDataModule(Owner).OnDestroy := nil; ! end; AppInstances.KillInstance; end; |