PRB: User-Defined onexit/atexit/cexit Not Called If /MD or /MDd

ID: Q199521


The information in this article applies to:
  • Microsoft Visual C++, Macintosh Cross-Development Addon, versions 4.0, 4.0b


SYMPTOMS

User-defined onexit, atexit, and cexit routines are not called for PowerMac applications using the C run-time dynamic-link library (DLL), /MD or /MDd.


CAUSE

DLLs and applications have different arrays of onexit pointers. The Win32 libraries have a method for ensuring both arrays are run through when the application terminates; however, this was not put in place for PowerMac DLLs.

Also, note that special handling is required for user-built DLLs!


RESOLUTION

Following are some possible ways to resolve this problem:

  • Use the static version instead of the DLL version of the C run-time libraries.


  • Clean up in the destructor of a global C++ object.


Additional query words: _cexit cexit _onexit

Keywords : kbprg kbMAC kbVC kbDSupport MacPrgIss
Version : MACINTOSH:4.0,4.0b
Platform : MACINTOSH
Issue type : kbprb


Last Reviewed: December 3, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.