}
}
#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
-
}
#define Mkdir(path,mode) mkdir((path),(mode))
#ifndef PERL_SYS_TERM
-#define PERL_SYS_TERM() HINTS_REFCNT_TERM; OP_REFCNT_TERM; MALLOC_TERM; CloseSTDLIB();
+#define PERL_SYS_TERM() HINTS_REFCNT_TERM; OP_REFCNT_TERM; PERLIO_TERM; MALLOC_TERM; CloseSTDLIB();
#endif
#define BIT_BUCKET "NUL:"
void
Perl_win32_term(void)
{
+ dTHX;
HINTS_REFCNT_TERM;
OP_REFCNT_TERM;
- /* Can't call PERLIO_TERM here because that calls PerlMemShared_free()
- * but we're too late for that (at least when using PERL_IMPLICIT_SYS)
- * since we've already done perl_free(). */
+ PERLIO_TERM;
MALLOC_TERM;
}
DllExport void
Perl_win32_term(void)
{
+ dTHX;
HINTS_REFCNT_TERM;
OP_REFCNT_TERM;
- /* Can't call PERLIO_TERM here because that calls PerlMemShared_free()
- * but we're too late for that (at least when using PERL_IMPLICIT_SYS)
- * since we've already done perl_free(). */
+ PERLIO_TERM;
MALLOC_TERM;
}