diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c
index a3359e01e1d..f9d246019e9 100644
--- a/dlls/mshtml/htmlevent.c
+++ b/dlls/mshtml/htmlevent.c
@@ -1439,6 +1439,8 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event)
}
}
+ for(listener = listeners; listener < listeners + listeners_cnt; listener++)
+ IDispatch_Release(listener->function);
if(listeners != listeners_buf)
heap_free(listeners);
if(event->phase == DEP_CAPTURING_PHASE)