From 91205a2a4439d6e57c597ededdb8fdbb898b8c95 Mon Sep 17 00:00:00 2001 From: Dmitri Komarovski Date: Mon, 5 Dec 2022 11:51:19 +0100 Subject: [PATCH] Unsubscribe from the input event handler Class: 'Binding', method: 'RemovePropertyEvent'. If we don't do that, dotMemory (and probably other memory profiling tools) will report about an event leakage of 'PropertyNotifyHelper'. At the moment, nothing is done with the EventHandler, that is passed as an input parameter. Performing the change fixes the report of the memory profiling tool. --- src/Eto/Forms/Binding/Binding.helpers.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Eto/Forms/Binding/Binding.helpers.cs b/src/Eto/Forms/Binding/Binding.helpers.cs index 75af91b117..e100d81c8b 100644 --- a/src/Eto/Forms/Binding/Binding.helpers.cs +++ b/src/Eto/Forms/Binding/Binding.helpers.cs @@ -240,7 +240,10 @@ public static void RemovePropertyEvent(object obj, EventHandler eh) { var helper = eh.Target as PropertyNotifyHelper; if (helper != null) + { + helper.Changed -= eh; helper.Unregister(obj); + } } ///