diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2006-12-04 17:53:03 -0500 |
---|---|---|
committer | Steve Hay <SteveHay@planit.com> | 2006-12-05 09:41:44 +0000 |
commit | 3890ecea71e8d1097fd1d7614b8a095c06dbb4f5 (patch) | |
tree | 414640c76a224b2967fc88fa9c0563cd73b2dcb2 /perlio.c | |
parent | 1fa600a71f04d713560e5dadce85270a4041d8f1 (diff) | |
download | perl-3890ecea71e8d1097fd1d7614b8a095c06dbb4f5.tar.gz |
Re: When should PERL_SYS_TERM() be called? [was: Re: [PATCH] Re: [PATCH] Re: [PATCH] abstract mempool header testing]
Message-ID: <4574ED1F.40508@iki.fi>
Re-instates #29424 (previously reverted by #29451), now fixed to work
with PERL_IMPLICIT_SYS, thanks to Jan Dubois. Also adds PERLIO_TERM to
the Symbian port.
p4raw-id: //depot/perl@29465
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -2412,19 +2412,19 @@ void PerlIO_teardown(pTHX) /* Call only from PERL_SYS_TERM(). */ } } #endif -#ifdef USE_ITHREADS - MUTEX_LOCK(&PL_perlio_mutex); -#endif +#if !defined(WIN32) || !defined(PERL_IMPLICIT_SYS) + /* On Windows, under PERL_IMPLICIT_SYS, all memory allocated by + * PerlMemShared_...() will be freed anyways when PL_curinterp + * is being destroyed. */ if (PL_perlio_fd_refcnt_size /* Assuming initial size of zero. */ && PL_perlio_fd_refcnt) { - PerlMemShared_free(PL_perlio_fd_refcnt); /* Not Safefree() because was allocated with PerlMemShared_realloc(). */ + /* Not bothering with PL_perlio_mutex since by now all the + * interpreters are gone. */ + PerlMemShared_free(PL_perlio_fd_refcnt); PL_perlio_fd_refcnt = NULL; PL_perlio_fd_refcnt_size = 0; } -#ifdef USE_ITHREADS - MUTEX_UNLOCK(&PL_perlio_mutex); #endif - } |