Skip to content

Fix memory leaks due to spurious handle increment and add unit tests #704

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 6 commits into from
Jul 23, 2018

Conversation

williamsardar
Copy link
Contributor

@williamsardar williamsardar commented Jul 20, 2018

What does this implement/fix? Explain your changes.

Fix memory leaks due to spurious handle increment and add unit tests
...

Does this close any currently open issues?

Issue #691
...

Any other comments?

...

Checklist

Check all those that are applicable and complete.

  • [ x ] Make sure to include one or more tests for your change
  • [ x ] If an enhancement PR, please create docs and at best an example
  • [ x ] Add yourself to AUTHORS
  • [ x ] Updated the CHANGELOG

@codecov
Copy link

codecov bot commented Jul 20, 2018

Codecov Report

Merging #704 into master will increase coverage by 0.45%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #704      +/-   ##
=========================================
+ Coverage   76.94%   77.4%   +0.45%     
=========================================
  Files          63      63              
  Lines        5592    5589       -3     
  Branches      892     892              
=========================================
+ Hits         4303    4326      +23     
+ Misses        998     970      -28     
- Partials      291     293       +2
Flag Coverage Δ
#setup_linux 69.42% <ø> (ø) ⬆️
#setup_windows 76.57% <100%> (+0.45%) ⬆️
Impacted Files Coverage Δ
src/runtime/overload.cs 73.91% <ø> (+15.57%) ⬆️
src/runtime/methodbinding.cs 79.59% <ø> (-0.41%) ⬇️
src/runtime/constructorbinding.cs 39.43% <100%> (+29.57%) ⬆️
src/runtime/runtime.cs 91.37% <0%> (+0.39%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 611814c...a97a776. Read the comment docs.

@filmor
Copy link
Member

filmor commented Jul 23, 2018

There are probably more issues like this in the code, essentially every class derived from ExtensionType does not need an additional Incref as far as I can see, since the PyType_GenericAlloc call in the constructor will already lead to a refcount of 1.

@filmor filmor merged commit fb84cd2 into pythonnet:master Jul 23, 2018
@filmor
Copy link
Member

filmor commented Jul 23, 2018

Thank you very much for your contribution :)

@williamsardar
Copy link
Contributor Author

@filmor thanks for the merge. Any indication as to when the next release might happen?

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.

2 participants