From a586e5b6ae64fc46496249b2fd35bec613e3a724 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 10 May 2005 16:08:46 +0000 Subject: [PATCH] * dcrt0.cc (dll_crt0_1): Call cygwin_exit to ensure that destructors are handled correctly. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/dcrt0.cc | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7fead992c..16d3e876f 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2005-05-10 Christopher Faylor + + * dcrt0.cc (dll_crt0_1): Call cygwin_exit to ensure that destructors + are handled correctly. + 2005-05-10 Corinna Vinschen * path.cc (path_conv::check): Set correct file attributes for socket diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index a2e458f89..a29722968 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -41,6 +41,8 @@ details. */ #define PREMAIN_LEN (sizeof (user_data->premain) / sizeof (user_data->premain[0])) +extern "C" void cygwin_exit (int); + void ld_preload (); HANDLE NO_COPY hMainProc = (HANDLE) -1; @@ -885,7 +887,7 @@ dll_crt0_1 (char *) wait_for_sigthread (); ld_preload (); if (user_data->main) - exit (user_data->main (__argc, __argv, *user_data->envptr)); + cygwin_exit (user_data->main (__argc, __argv, *user_data->envptr)); } struct _reent *