diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-16 03:18:41 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-16 03:18:41 +0000 |
commit | 1c0ca838512883f7a705e306f80a7c0a95277a87 (patch) | |
tree | 22dcb6bd4b328050cf8bbb56ff33c75af672ddef /win32/perlhost.h | |
parent | f433d095c701fc99be6dfb685ceb5f4cb6fafb97 (diff) | |
download | perl-1c0ca838512883f7a705e306f80a7c0a95277a87.tar.gz |
due to an oversight during PERL_OBJECT migration, hosts created
by pseudo-fork were never being deleted, leading to a sizeable
memory leak; std FDs in pseudo-children are now closed
automatically to avoid resource leaks; basic infinite looping
fork() test works without leaking again in non-PERL_OBJECT
build
p4raw-id: //depot/perl@5761
Diffstat (limited to 'win32/perlhost.h')
-rw-r--r-- | win32/perlhost.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/win32/perlhost.h b/win32/perlhost.h index 02b9cb4bc4..cac05b2832 100644 --- a/win32/perlhost.h +++ b/win32/perlhost.h @@ -1719,6 +1719,13 @@ restart: PL_main_root = Nullop; } + /* close the std handles to avoid fd leaks */ + { + do_close(gv_fetchpv("STDIN", TRUE, SVt_PVIO), FALSE); + do_close(gv_fetchpv("STDOUT", TRUE, SVt_PVIO), FALSE); + do_close(gv_fetchpv("STDERR", TRUE, SVt_PVIO), FALSE); + } + /* destroy everything (waits for any pseudo-forked children) */ perl_destruct(my_perl); perl_free(my_perl); |