X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FThread-Cleanup.git;a=blobdiff_plain;f=Cleanup.xs;fp=Cleanup.xs;h=4fd00ecb41ee67c1ddb1da76baa34f595698b6a6;hp=43ab9496eff85fb33ed27dbdb396190d844385c9;hb=cc6a2e4288f5e12c19ba7d09e9c82e7f5f1e8bfa;hpb=37553cfe3ca2a0f8527eb53961b35ac5e157a3c6 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); }