diff --git a/src/Core/Events.xs b/src/Core/Events.xs index faa7cfe6..0b99f8a9 100644 --- a/src/Core/Events.xs +++ b/src/Core/Events.xs @@ -102,7 +102,8 @@ void events_set_event_filter(callback) SV* callback CODE: - eventfiltersv = callback; + SvREFCNT_dec(eventfiltersv); + eventfiltersv = SvREFCNT_inc_simple(callback); SDL_SetEventFilter((SDL_EventFilter) eventfilter_cb); AV *