Which is the proper way to terminate a delphi application?

前端 未结 3 1253
既然无缘
既然无缘 2021-02-05 06:41

I would like to terminate a Delphi application without executing any other code line and I\'m wondering about which is the proper way to do this. Furthermore, I would like to kn

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-05 07:36

    I would like to terminate a Delphi application without executing any other code.

    Neither Application.Terminate nor Halt will achieve that. The former performs an orderly termination. Lots of code will execute. Calling Halt is more hopeful. That is an abnormal termination. But unit finalization code is executed.

    If you wish to exit as quickly as possible, executing the minimum amount of code along the way, call ExitProcess. That's the final step of Halt and by calling ExitProcess directly you avoid all the steps that Halt takes before it calls ExitProcess.

提交回复
热议问题