RAD Studio
ContentsIndex
PreviousUpNext
atexit, #pragma exit, And Destructors

All global objects are active until the code in all exit procedures has executed. Local variables, including those declared in the main function, are destroyed as they go out of scope. The order of execution at the end of a program is as follows:

  • atexit() functions are executed in the order they were inserted.
  • #pragma exit functions are executed in the order of their priority codes.
  • Destructors for global variables are called.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!