]> git.vpit.fr Git - perl/modules/re-engine-Plugin.git/commitdiff
Fix the refcount of the num_capture_buff_* callbacks when we replace one
authorVincent Pit <vince@profvince.com>
Sat, 29 Aug 2009 15:32:47 +0000 (17:32 +0200)
committerVincent Pit <vince@profvince.com>
Sat, 29 Aug 2009 15:32:47 +0000 (17:32 +0200)
Plugin.xs

index c5e9ebd465648482d86e78dfdc9721861af6c46e..fab9308b839fabca90018f5f5adf9e1b292a8bc9 100644 (file)
--- a/Plugin.xs
+++ b/Plugin.xs
@@ -772,6 +772,7 @@ void
 _num_capture_buff_FETCH(re::engine::Plugin self, ...)
 PPCODE:
     if (items > 1) {
+        SvREFCNT_dec(self->cb_num_capture_buff_FETCH);
         self->cb_num_capture_buff_FETCH = ST(1);
         SvREFCNT_inc(self->cb_num_capture_buff_FETCH);
     }
@@ -780,6 +781,7 @@ void
 _num_capture_buff_STORE(re::engine::Plugin self, ...)
 PPCODE:
     if (items > 1) {
+        SvREFCNT_dec(self->cb_num_capture_buff_STORE);
         self->cb_num_capture_buff_STORE = ST(1);
         SvREFCNT_inc(self->cb_num_capture_buff_STORE);
     }
@@ -788,6 +790,7 @@ void
 _num_capture_buff_LENGTH(re::engine::Plugin self, ...)
 PPCODE:
     if (items > 1) {
+        SvREFCNT_dec(self->cb_num_capture_buff_LENGTH);
         self->cb_num_capture_buff_LENGTH = ST(1);
         SvREFCNT_inc(self->cb_num_capture_buff_LENGTH);
     }