]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commitdiff
Stop leaking the SVs that reference the callbacks
authorVincent Pit <vince@profvince.com>
Sun, 29 Nov 2009 23:14:30 +0000 (00:14 +0100)
committerVincent Pit <vince@profvince.com>
Sun, 29 Nov 2009 23:14:30 +0000 (00:14 +0100)
Magic.xs

index 251fc3c75f4fcbc34f4ae470768864bb807caf86..003f52ef84d7df4c91f6a9d0a3cdcba776708cf5 100644 (file)
--- 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);