From: Vincent Pit Date: Sun, 29 Nov 2009 23:14:30 +0000 (+0100) Subject: Stop leaking the SVs that reference the callbacks X-Git-Tag: v0.39~11 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=700dd2952631bcc41697ee3d10e01ed088f01c45;p=perl%2Fmodules%2FVariable-Magic.git Stop leaking the SVs that reference the callbacks --- diff --git a/Magic.xs b/Magic.xs index 251fc3c..003f52e 100644 --- a/Magic.xs +++ b/Magic.xs @@ -363,26 +363,26 @@ STATIC void vmg_mgwiz_free(pTHX_ MGWIZ *w) { if (!w) return; - if (w->cb_data) SvREFCNT_dec(SvRV(w->cb_data)); - if (w->cb_get) SvREFCNT_dec(SvRV(w->cb_get)); - if (w->cb_set) SvREFCNT_dec(SvRV(w->cb_set)); - if (w->cb_len) SvREFCNT_dec(SvRV(w->cb_len)); - if (w->cb_clear) SvREFCNT_dec(SvRV(w->cb_clear)); - if (w->cb_free) SvREFCNT_dec(SvRV(w->cb_free)); + if (w->cb_data) SvREFCNT_dec(w->cb_data); + if (w->cb_get) SvREFCNT_dec(w->cb_get); + if (w->cb_set) SvREFCNT_dec(w->cb_set); + if (w->cb_len) SvREFCNT_dec(w->cb_len); + if (w->cb_clear) SvREFCNT_dec(w->cb_clear); + if (w->cb_free) SvREFCNT_dec(w->cb_free); #if MGf_COPY - if (w->cb_copy) SvREFCNT_dec(SvRV(w->cb_copy)); + if (w->cb_copy) SvREFCNT_dec(w->cb_copy); #endif /* MGf_COPY */ #if 0 /* MGf_DUP */ - if (w->cb_dup) SvREFCNT_dec(SvRV(w->cb_dup)); + if (w->cb_dup) SvREFCNT_dec(w->cb_dup); #endif /* MGf_DUP */ #if MGf_LOCAL - if (w->cb_local) SvREFCNT_dec(SvRV(w->cb_local)); + if (w->cb_local) SvREFCNT_dec(w->cb_local); #endif /* MGf_LOCAL */ #if VMG_UVAR - if (w->cb_fetch) SvREFCNT_dec(SvRV(w->cb_fetch)); - if (w->cb_store) SvREFCNT_dec(SvRV(w->cb_store)); - if (w->cb_exists) SvREFCNT_dec(SvRV(w->cb_exists)); - if (w->cb_delete) SvREFCNT_dec(SvRV(w->cb_delete)); + if (w->cb_fetch) SvREFCNT_dec(w->cb_fetch); + if (w->cb_store) SvREFCNT_dec(w->cb_store); + if (w->cb_exists) SvREFCNT_dec(w->cb_exists); + if (w->cb_delete) SvREFCNT_dec(w->cb_delete); #endif /* VMG_UVAR */ Safefree(w->vtbl);