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

Skip to content

Memory leak for Cursor useblit=True on PySide/Python3 #4377

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
May 8, 2015
Merged

Memory leak for Cursor useblit=True on PySide/Python3 #4377

merged 1 commit into from
May 8, 2015

Conversation

mfitzp
Copy link
Member

@mfitzp mfitzp commented Apr 24, 2015

There is a memory leak in PySide under Python3. When creating
QImage objects from a data buffer the reference to the buffer
is not released. This leads to a memory leak when moving the
cursor around the window, and eventually a crash.

A workaround is to manually set the reference counter to the
correct value 1 after creating the QImage object. This is
a temporary local variable, and no side effects are expected.

This is a fix for bug #4283

There is a memory leak in PySide under Python3. When creating
QImage objects from a data buffer the reference to the buffer
is not released. This leads to a memory leak when moving the
cursor around the window, and eventually a crash.

A workaround is to manually set the reference counter to the
correct value `1` after creating the QImage object. This is
a temporary local variable, and no side effects are expected.
@tacaswell tacaswell added this to the next point release milestone Apr 24, 2015
@mfitzp
Copy link
Member Author

mfitzp commented Apr 30, 2015

I've tested this on Python 3 on Windows with PySide, PyQt4 and PyQt5 and on MacOSX PyQt5 and there is no evidence of memory leakage or other errors. Should be able to test on Linux this evening.

Travis is failing on PEP8 I'll take a look at that.

@tacaswell
Copy link
Member

attn @mdboom can you take a look at this?

@tacaswell tacaswell merged commit 078ddc1 into matplotlib:master May 8, 2015
tacaswell added a commit that referenced this pull request May 8, 2015
FIX : memory leak for Cursor usblit=True on PySide/Python3

@tacaswell fixed up whitespace and merged locally
@mfitzp mfitzp deleted the pyside-cursor-memory-leak branch July 5, 2015 19:19
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