From: Yuval Kogman Date: Wed, 20 Aug 2008 09:54:51 +0000 (+0000) Subject: don't leak SV for default X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9be0171f41886a68c4452c21c18f61edcd8d6979;p=gitmo%2FMoose.git don't leak SV for default --- diff --git a/Moose.xs b/Moose.xs index 5183a20..1bd6c12 100644 --- a/Moose.xs +++ b/Moose.xs @@ -538,7 +538,7 @@ STATIC void init_attr (MI *mi, ATTR *attr, AV *desc) { attr->type_constraint = newSVsv(tc); SvREFCNT_inc(attr->trigger); SvREFCNT_inc(attr->initializer); - if ( flags & ATTR_TCREFCNT ) SvREFCNT_inc(attr->tc_check.sv); + if ( flags & ATTR_TCREFCNT ) SvREFCNT_inc(attr->tc_check.sv); if ( flags & ATTR_DEFREFCNT ) SvREFCNT_inc(attr->def.sv); attr->slot_sv = newSVpvn_share(pv, len, hash); @@ -591,7 +591,8 @@ STATIC void delete_mi (pTHX_ MI *mi) { SvREFCNT_dec(attr->cvs); SvREFCNT_dec(attr->slot_sv); SvREFCNT_dec(attr->type_constraint); - if ( attr->flags & ATTR_TCREFCNT ) SvREFCNT_dec(attr->tc_check.sv); + if ( attr->flags & ATTR_TCREFCNT ) SvREFCNT_dec(attr->tc_check.sv); + if ( attr->flags & ATTR_DEFREFCNT ) SvREFCNT_dec(attr->def.sv); SvREFCNT_dec(attr->initializer); SvREFCNT_dec(attr->trigger); SvREFCNT_dec(attr->meta_attr);