mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-19 04:49:25 +08:00
2002-04-16 Thomas Pfaff <tpfaff@gmx.net>
* dll_init.h (per_process::dtors_run): New member. * dll_init.cc (per_module::run_dtors): Run dtors only once. (dll::init): Initialize dtors_run flag.
This commit is contained in:
parent
e9f1cbd011
commit
4ce4e69db6
@ -1,3 +1,9 @@
|
|||||||
|
2002-04-16 Thomas Pfaff <tpfaff@gmx.net>
|
||||||
|
|
||||||
|
* dll_init.h (per_process::dtors_run): New member.
|
||||||
|
* dll_init.cc (per_module::run_dtors): Run dtors only once.
|
||||||
|
(dll::init): Initialize dtors_run flag.
|
||||||
|
|
||||||
Wed Apr 17 11:27:04 2002 Jason Tishler <jason@tishler.net>
|
Wed Apr 17 11:27:04 2002 Jason Tishler <jason@tishler.net>
|
||||||
|
|
||||||
* security.cc (get_lsa_srv_inf): Prevent extraneous backslashes for
|
* security.cc (get_lsa_srv_inf): Prevent extraneous backslashes for
|
||||||
|
@ -59,6 +59,11 @@ void
|
|||||||
per_module::run_dtors ()
|
per_module::run_dtors ()
|
||||||
{
|
{
|
||||||
void (**pfunc)() = dtors;
|
void (**pfunc)() = dtors;
|
||||||
|
|
||||||
|
if( dtors_run )
|
||||||
|
return;
|
||||||
|
dtors_run = true;
|
||||||
|
|
||||||
for (int i = 1; pfunc[i]; i++)
|
for (int i = 1; pfunc[i]; i++)
|
||||||
(pfunc[i]) ();
|
(pfunc[i]) ();
|
||||||
}
|
}
|
||||||
@ -72,6 +77,8 @@ dll::init ()
|
|||||||
/* Why didn't we just import this variable? */
|
/* Why didn't we just import this variable? */
|
||||||
*(p.envptr) = __cygwin_environ;
|
*(p.envptr) = __cygwin_environ;
|
||||||
|
|
||||||
|
p.dtors_run = false;
|
||||||
|
|
||||||
/* Don't run constructors or the "main" if we've forked. */
|
/* Don't run constructors or the "main" if we've forked. */
|
||||||
if (!in_forkee)
|
if (!in_forkee)
|
||||||
{
|
{
|
||||||
|
@ -13,6 +13,7 @@ struct per_module
|
|||||||
char ***envptr;
|
char ***envptr;
|
||||||
void (**ctors)(void);
|
void (**ctors)(void);
|
||||||
void (**dtors)(void);
|
void (**dtors)(void);
|
||||||
|
bool dtors_run;
|
||||||
void *data_start;
|
void *data_start;
|
||||||
void *data_end;
|
void *data_end;
|
||||||
void *bss_start;
|
void *bss_start;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user