X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FThread-Cleanup.git;a=blobdiff_plain;f=Cleanup.xs;h=4fd00ecb41ee67c1ddb1da76baa34f595698b6a6;hp=43ab9496eff85fb33ed27dbdb396190d844385c9;hb=HEAD;hpb=adfcfb78d604012463e00090dfb549381d98cd6e diff --git a/Cleanup.xs b/Cleanup.xs index 43ab949..4fd00ec 100644 --- a/Cleanup.xs +++ b/Cleanup.xs @@ -65,9 +65,8 @@ PPCODE: CV *cv = GvCV(gv); if (!PL_endav) PL_endav = newAV(); - av_unshift(PL_endav, 1); SvREFCNT_inc(cv); - if (!av_store(PL_endav, 0, (SV *) cv)) + if (!av_store(PL_endav, av_len(PL_endav) + 1, (SV *) cv)) SvREFCNT_dec(cv); sv_magicext((SV *) PL_endav, NULL, PERL_MAGIC_ext, &tc_endav_vtbl, NULL, 0); }