Skip to content

Commit

Permalink
Unsubscribe from the input event handler
Browse files Browse the repository at this point in the history
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<EventArgs>, that is passed as an
input parameter. Performing the change fixes the
report of the memory profiling tool.
  • Loading branch information
Dmitri-Kom committed Dec 5, 2022
1 parent d51ed9c commit 91205a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Eto/Forms/Binding/Binding.helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,10 @@ public static void RemovePropertyEvent(object obj, EventHandler<EventArgs> eh)
{
var helper = eh.Target as PropertyNotifyHelper;
if (helper != null)
{
helper.Changed -= eh;
helper.Unregister(obj);
}
}

/// <summary>
Expand Down

0 comments on commit 91205a2

Please sign in to comment.