This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix more shared threads leaks: add SAVETMPS to the second branch
authorDave Mitchell <davem@fdisolutions.com>
Mon, 27 Oct 2003 22:01:12 +0000 (22:01 +0000)
committerDave Mitchell <davem@fdisolutions.com>
Mon, 27 Oct 2003 22:01:12 +0000 (22:01 +0000)
of sharedsv_scalar_store().

p4raw-id: //depot/perl@21564

ext/threads/shared/shared.xs

index 4bf4c78..853b2b7 100644 (file)
@@ -463,12 +463,16 @@ sharedsv_scalar_store(pTHX_ SV *sv, shared_sv *shared)
     else {
         SvTEMP_off(sv);
        SHARED_CONTEXT;
+       ENTER;
+       SAVETMPS;
        sv_setsv_nomg(SHAREDSvPTR(shared), sv);
        if(SvOBJECT(sv)) {
          SV* fake_stash = newSVpv(HvNAME(SvSTASH(sv)),0);
          SvOBJECT_on(SHAREDSvPTR(shared));
          SvSTASH(SHAREDSvPTR(shared)) = (HV*)fake_stash;
        }
+       FREETMPS;
+       LEAVE;
        CALLER_CONTEXT;
     }
     if (!allowed) {