[win32] fix refcounting of GvSTASH() when glob becomes nought
authorGurusamy Sarathy <gsar@cpan.org>
Sat, 4 Apr 1998 22:35:54 +0000 (22:35 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Sat, 4 Apr 1998 22:35:54 +0000 (22:35 +0000)
(this takes care of the "unbalanced strtab refcount" problem)

p4raw-id: //depot/win32/perl@880

sv.c

diff --git a/sv.c b/sv.c
index 1abc3fd..2711551 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -4115,6 +4115,10 @@ sv_unglob(SV *sv)
     SvFAKE_off(sv);
     if (GvGP(sv))
        gp_free((GV*)sv);
+    if (GvSTASH(sv)) {
+       SvREFCNT_dec(GvSTASH(sv));
+       GvSTASH(sv) = Nullhv;
+    }
     sv_unmagic(sv, '*');
     Safefree(GvNAME(sv));
     GvMULTI_off(sv);