From: Vincent Pit Date: Sat, 29 Aug 2009 15:32:47 +0000 (+0200) Subject: Fix the refcount of the num_capture_buff_* callbacks when we replace one X-Git-Tag: v0.08~8 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=18ec04e7558b13fcd57575f566794a909ca60aca;p=perl%2Fmodules%2Fre-engine-Plugin.git Fix the refcount of the num_capture_buff_* callbacks when we replace one --- diff --git a/Plugin.xs b/Plugin.xs index c5e9ebd..fab9308 100644 --- 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); }