Thanks to visit codestin.com
Credit goes to github.com

Skip to content

_tkinter: Fix refleak in getint() #2153

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 1 commit into from
Jun 13, 2017
Merged

_tkinter: Fix refleak in getint() #2153

merged 1 commit into from
Jun 13, 2017

Conversation

vstinner
Copy link
Member

PyNumber_Int() creates a new reference: need to decrement result
reference counter.

PyNumber_Int() creates a new reference: need to decrement result
reference counter.
@vstinner
Copy link
Member Author

Currently, test_tcl leaks on 2.7:

http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Refleaks%202.7/builds/24/steps/test/logs/stdio

1:17:14 [208/403/2] test_tcl failed (32 sec) -- running: test_bsddb3 (1797 sec), test_weakref (4584 sec), test_regrtest (3553 sec)
beginning 6 repetitions
123456
......
test_tcl leaked [53, 53, 53] references, sum=159

With my change, it doesn't leak anymore:

haypo@selma$ ./python -m test -R 3:3 test_tcl
0:00:00 [1/1] test_tcl
beginning 6 repetitions
123456
......
1 test OK.

@vstinner vstinner merged commit bdd3567 into python:2.7 Jun 13, 2017
@vstinner vstinner deleted the tcl_refleak27 branch June 13, 2017 09:12
@serhiy-storchaka serhiy-storchaka added the type-bug An unexpected behavior, bug, or error label Jun 13, 2017
@serhiy-storchaka
Copy link
Member

Good catch!

@vstinner
Copy link
Member Author

Good catch!

Say thank you to @zware who installed a new "refleak" buildbot for Windows. I wouldn't run the full test suite with -R 3:3 on my own, it's too long (2 hours?). The bisection was trivial, the bug too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants