The Wayback Machine - https://web.archive.org/web/20221117144712/https://github.com/pythonnet/pythonnet/pull/1973
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete target object from event handler collections when it has no more event handlers #1973

Merged
merged 3 commits into from Oct 14, 2022

Conversation

lostmsu
Copy link
Member

@lostmsu lostmsu commented Oct 13, 2022

What does this implement/fix? Explain your changes.

The objects were leaking because they were kept as keys in a dictionary, that stored event handlers corresponding to object.

This change ensures that when the last handler is removed from an object, the object is removed from that dictionary.

Does this close any currently open issues?

fixes #1972

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • Updated the CHANGELOG

@filmor filmor merged commit ce76dae into pythonnet:master Oct 14, 2022
19 checks passed
@lostmsu lostmsu deleted the bugs/1972 branch Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak when attaching event handlers from Python
2 participants