fix PL_defoutgv leak under threads
Gurusamy Sarathy [Thu, 26 Nov 1998 10:16:54 +0000 (10:16 +0000)]
p4raw-id: //depot/perl@2301

ext/Thread/Thread.xs

index 4ca76ad..09751c5 100644 (file)
@@ -114,8 +114,9 @@ threadstart(void *arg)
                          thr, SvPEEK(TOPs)));
 
     sv = POPs;
-    SAVETMPS;
     PUTBACK;
+    ENTER;
+    SAVETMPS;
     perl_call_sv(sv, G_ARRAY|G_EVAL);
     SPAGAIN;
     retval = SP - (PL_stack_base + oldmark);
@@ -140,6 +141,7 @@ threadstart(void *arg)
            sv_setsv(*av_fetch(av, i, TRUE), SvREFCNT_inc(*SP));
     }
     FREETMPS;
+    LEAVE;
 
   finishoff:
 #if 0    
@@ -176,7 +178,7 @@ threadstart(void *arg)
     Safefree(PL_screamnext);
     Safefree(PL_reg_start_tmp);
     SvREFCNT_dec(PL_lastscream);
-    /*SvREFCNT_dec(PL_defoutgv);*/
+    SvREFCNT_dec(PL_defoutgv);
 
     MUTEX_LOCK(&thr->mutex);
     DEBUG_S(PerlIO_printf(PerlIO_stderr(),