diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-06-02 18:22:06 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-06-02 18:22:06 +0000 |
commit | f4dd75d9918abbf789a5eca453b89168cad18ff0 (patch) | |
tree | c0348eda98b997c301b76ab702c0c93d888d87f5 /op.c | |
parent | 4ebbc97598d793d933009eab4334e3bc88b8de4e (diff) | |
download | perl-f4dd75d9918abbf789a5eca453b89168cad18ff0.tar.gz |
fix small eval"" memory leaks under USE_ITHREADS
p4raw-id: //depot/perl@6194
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -844,8 +844,8 @@ S_cop_free(pTHX_ COP* cop) { Safefree(cop->cop_label); #ifdef USE_ITHREADS - Safefree(CopFILE(cop)); /* XXXXX share in a pvtable? */ - Safefree(CopSTASHPV(cop)); /* XXXXX share in a pvtable? */ + Safefree(CopFILE(cop)); /* XXX share in a pvtable? */ + Safefree(CopSTASHPV(cop)); /* XXX share in a pvtable? */ #else /* NOTE: COP.cop_stash is not refcounted */ SvREFCNT_dec(CopFILEGV(cop)); @@ -3499,9 +3499,9 @@ Perl_newSTATEOP(pTHX_ I32 flags, char *label, OP *o) PL_copline = NOLINE; } #ifdef USE_ITHREADS - CopFILE_set(cop, CopFILE(PL_curcop)); /* XXXXX share in a pvtable? */ + CopFILE_set(cop, CopFILE(PL_curcop)); /* XXX share in a pvtable? */ #else - CopFILEGV_set(cop, (GV*)SvREFCNT_inc(CopFILEGV(PL_curcop))); + CopFILEGV_set(cop, CopFILEGV(PL_curcop)); #endif CopSTASH_set(cop, PL_curstash); @@ -4709,10 +4709,11 @@ Perl_newCONSTSUB(pTHX_ HV *stash, char *name, SV *sv) dTHR; ENTER; - SAVECOPLINE(PL_curcop); - SAVEHINTS(); + SAVECOPLINE(PL_curcop); CopLINE_set(PL_curcop, PL_copline); + + SAVEHINTS(); PL_hints &= ~HINT_BLOCK_SCOPE; if (stash) { |