Change 16383 by rgs@rgs-home on 2002/05/03 20:45:58

        Subject: [PATCH scope.c] Re: local($tied->{foo}) leaks
        From: Dave Mitchell <[EMAIL PROTECTED]>
        Date: Fri, 3 May 2002 21:12:10 +0100
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

.... //depot/perl/scope.c#95 edit

Differences ...

==== //depot/perl/scope.c#95 (text) ====
Index: perl/scope.c
--- perl/scope.c.~1~    Fri May  3 15:00:05 2002
+++ perl/scope.c        Fri May  3 15:00:05 2002
@@ -206,6 +206,12 @@
        PL_localizing = 1;
        SvSETMAGIC(sv);
        PL_localizing = 0;
+       /* If we're localizing a tied array/hash element, this new sv
+        * won't actually be stored in the array/hash - so it won't get
+        * reaped when the localize ends. Ensure it gets reaped by
+        * mortifying it instead. DAPM */
+       if (SvTIED_mg(sv, PERL_MAGIC_tiedelem))
+           sv_2mortal(sv);
     }
     return sv;
 }
End of Patch.

Reply via email to