summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-06-02 18:22:06 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-06-02 18:22:06 +0000
commitf4dd75d9918abbf789a5eca453b89168cad18ff0 (patch)
treec0348eda98b997c301b76ab702c0c93d888d87f5 /perl.c
parent4ebbc97598d793d933009eab4334e3bc88b8de4e (diff)
downloadperl-f4dd75d9918abbf789a5eca453b89168cad18ff0.tar.gz
fix small eval"" memory leaks under USE_ITHREADS
p4raw-id: //depot/perl@6194
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/perl.c b/perl.c
index 5df462db9d..801dbe15f2 100644
--- a/perl.c
+++ b/perl.c
@@ -600,9 +600,14 @@ perl_destruct(pTHXx)
if (!specialWARN(PL_compiling.cop_warnings))
SvREFCNT_dec(PL_compiling.cop_warnings);
PL_compiling.cop_warnings = Nullsv;
-#ifndef USE_ITHREADS
+#ifdef USE_ITHREADS
+ Safefree(CopFILE(&PL_compiling));
+ CopFILE(&PL_compiling) = Nullch;
+ Safefree(CopSTASHPV(&PL_compiling));
+#else
SvREFCNT_dec(CopFILEGV(&PL_compiling));
- CopFILEGV_set(&PL_compiling, Nullgv);
+ CopFILEGV(&PL_compiling) = Nullgv;
+ /* cop_stash is not refcounted */
#endif
/* Prepare to destruct main symbol table. */
@@ -2511,6 +2516,11 @@ S_open_script(pTHX_ char *scriptname, bool dosearch, SV *sv, int *fdscript)
}
}
+#ifdef USE_ITHREADS
+ Safefree(CopFILE(PL_curcop));
+#else
+ SvREFCNT_dec(CopFILEGV(PL_curcop));
+#endif
CopFILE_set(PL_curcop, PL_origfilename);
if (strEQ(PL_origfilename,"-"))
scriptname = "";