From 4cc52e0fc8c9a9a712565c95e0da97033f59c541 Mon Sep 17 00:00:00 2001 From: "v.potekhin" Date: Tue, 6 Feb 2024 15:33:50 +0300 Subject: [PATCH] fix: fix memory leak in `capture` plugin --- projects/ng-event-plugins/src/plugins/options.plugin.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/ng-event-plugins/src/plugins/options.plugin.ts b/projects/ng-event-plugins/src/plugins/options.plugin.ts index de7a478..af6e621 100644 --- a/projects/ng-event-plugins/src/plugins/options.plugin.ts +++ b/projects/ng-event-plugins/src/plugins/options.plugin.ts @@ -20,6 +20,11 @@ export class OptionsEventPlugin extends AbstractEventPlugin { capture: event.includes('.capture'), }); - return () => element.removeEventListener(this.unwrap(event), handler); + return () => + element.removeEventListener( + this.unwrap(event), + handler, + event.includes('.capture'), + ); } }