workaround PySide QByteArray leak on conda builds#3268
workaround PySide QByteArray leak on conda builds#3268j9ac9k merged 1 commit intopyqtgraph:masterfrom
Conversation
|
Since the "fix" has been merged into the conda-forge feedstock, do we want to have the workaround enabled only for specific versions of pyside bindings; or is there minimal downside to the workaround that that's not needed? |
|
I did a check, the issue is also present in conda-forge's build of PySide2 5.15.15. refcnt leak introduced: the following comment says that Qt defaults to limited-api builds (and therefore their builds aren't affected by the leak introduced): I couldn't find where pyside2-feedstock was configuring for non-limited-api build though. Given that conda-forge has patched PySide2 to build for Python 3.11, and seem willing (conda-forge/pyside2-feedstock#246) to push it to Python 3.12, what is pyqtgraph's policy regarding support of PySide2 going to be?
For PySide6, we can don't apply the workaround. conda-forge PySide6 6.7.3 through PySide6 6.8.2 build 0 will have the leak. For PySide2, maybe we can apply the workaround? If PySide2 is a non-preferred binding for pyqtgraph, I guess penalizing it is not really an issue? i.e. better to be less efficient than having to worry about whether a leak is present for non-official builds. |
e4d7745 to
664ab25
Compare
|
Other places where the leak occurs:
|
|
For reference, pyqtgraph first started taking a memory view to QByteArray in this commit. (2021 August) PySide2 5.15.2 had already been released for some time. |
|
Thanks @pijyoi ! |
Addresses #3265 at the expense of penalizing the official Qt build of PySide6.
The leak only gets triggered for connect types "pairs", "array".
"finite" is also affected if there are a great many non-finite elements.
Note that 2 extra memory writes are made with this workaround.
bytearrayalways initializes its memory to 0bytearrayis converted into aQByteArray.(this second memory access could have been avoided if
QByteArray.fromRawDatawas working. But alas, the binding for it is broken)