]> git.vpit.fr Git - perl/modules/re-engine-Plugin.git/commitdiff
Stop leaking the underlying re::engine::Plugin object
authorVincent Pit <perl@profvince.com>
Wed, 4 Nov 2015 18:10:40 +0000 (16:10 -0200)
committerVincent Pit <perl@profvince.com>
Wed, 4 Nov 2015 23:57:56 +0000 (21:57 -0200)
Plugin.xs

index af917b7d7e1ff5dc07010c033d8a95df5dccc248..da33ce2ff9050a130fe6f6d79d58d8b3b6262814 100644 (file)
--- a/Plugin.xs
+++ b/Plugin.xs
@@ -209,7 +209,6 @@ Plugin_comp(pTHX_ const SV * const pattern, const U32 flags)
 
  /* Our blessed object */
  obj = newSV(0);
- SvREFCNT_inc_simple_void_NN(obj);
  Newxz(re, 1, struct replug);
  sv_setref_pv(obj, XSH_PACKAGE, (void *) re);
 
@@ -378,8 +377,11 @@ Plugin_free(pTHX_ REGEXP * const RX)
  SvREFCNT_dec(self->cb_num_capture_buff_LENGTH);
 
  self->rx = NULL;
+
  Safefree(self);
 
+ SvREFCNT_dec(rx->pprivate);
+
 /*
  dSP;
  SV *callback;