Remove workaround for memory leak in QImage#1223
Conversation
|
Could the if block also be deleted, leaving only the code from the current |
Suppose only one way to find out... let me make the change and see what the CI says.... |
|
@2xB looks like some failures are starting to trickle in through the CI, specifically on the PySide2 builds (I'll let it finish out to see if there is more of a pattern besides pyside1/2 fail, pyqt4/5 pass). |
|
PySide2 doesn't support "QImage(imgData.ctypes.data, ...)" Both PySide2 and PyQt5 support "QImage(imgData, ...)", i.e. just use the numpy buffer directly. Don't know about PySide1 and PyQt4 though. |
Thanks for pointing that out @pijyoi let's try it out! |
|
Good to know!
Well - It would look even more compact otherwise. This experimenting shows that the fix for old PyQt4 versions in the |
|
can't kill Py2/Qt4 support soon enough... |
|
Looks like this is failing for all PyQt4/5 versions (still CI runs are going). I think I'll revert back to how it was and leave it at that, or is there another change I should try? |
|
Okay, so technically this works, but image comparison tests in PyQt fail though... |
Ahh, I should have looked at the nature of the failures... you caught me being lazy ... you think it's worth updating the images being compared? |
361edce to
b0f148d
Compare
|
have to call it a night; I reverted to the state where CI passed across the board. |
|
I'm going to merge this as it stands, I suspect after we limit the number of supported libraries we're going to be taking a closer look at all these workarounds for the different bindings. |
|
I am sorry for somehow missing your question. I think your plan sounds good. |
|
@2xB I think that's a great idea (making better use of comments to describe workarounds). I'll try and be better about it in the future. |
I found some old comments in my code regarding PyQt5: So looks like PySide and PyQt codepaths can't be safely unified here as there may be some unknown/unwanted side effects. |
Do you think it would be worth testing again to see if this is an issue with Qt6 (or PyQt5 5.15)? |
I retested PyQt5 5.15 while adding PyQt6 support and documented it more thoroughly in the comments. In short, PyQt5 5.15 needs its own special case. The copying effect in PyQt5 can be demonstrated in the following code.. |
Fixes #724 - PySide2 < 5.12 should not be considered stable, and due to its age, pyqtgraph should not try and compensate with it by embedding workarounds.