2007. április 28., szombat

Application.Terminate or Halt() ?


Should I use Application.Terminate or Halt() ? And what are the differences?


Application.Terminate closes the main window and that way the application in a clean fashion. Halt() shuts down right away, e.g. memory may not be freed, tables are not closed and so on.

For D4: Halt can cause AV's on an NT system, usually with Runtime error 216, if DLL's are involved also 217 - Application.Terminate on the other hand cleans without AV.

But: Halt worked with D2, even the cleaning of the memory did work....

Then again, if you write a console application, you have to use halt(), since there probably is no Application object.

Nincsenek megjegyzések:

Megjegyzés küldése