Undeffing a gv in DESTROY triggered by undeffing the same gv
authorFather Chrysostomos <sprout@cpan.org>
Sun, 10 Nov 2013 20:04:51 +0000 (12:04 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 12 Nov 2013 00:13:19 +0000 (16:13 -0800)
commit4571f4a728fcf420c04fe45a1566d6d2f38d76ae
tree74c3c49a9eb922035810d4cbc48b473eb32bd371
parent5deb1341767b498cac376b4d0fcf168a328c2d94
Undeffing a gv in DESTROY triggered by undeffing the same gv

$ ./perl -Ilib -e 'sub foo{} bless \&foo; DESTROY { undef *foo } undef *foo'
Attempt to free unreferenced glob pointers, Perl interpreter: 0x7fd6a3803200 at -e line 1.

Lowering the reference count on the glob pointer only after freeing
the contents fixes this.
gv.c
t/op/gv.t