8000 Delete target object from event handler collections when it has no more event handlers by lostmsu · Pull Request #1973 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

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

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

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
@lostmsu lostmsu deleted the bugs/1972 branch October 14, 2022 18:13
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 requ 3CED est may close these issues.

Memory leak when attaching event handlers from Python
2 participants
0