Details
Description
Hello,
I’m integrating the 5.15.8 version of both Qt and the corresponding QtForPython and I found what looks like an issue.
In the file generated for QIcon, I’ve got the function Sbk_QIconFunc_addFile which is doing, in case of using named parameters (if (kwds)):
- Copy in a auto dec ref object kwds: Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
* At the end when the dictionary is empty, it decrease it:if (PyDict_Size(kwds_dup) > 0) { errInfo = kwds_dup.release(); goto Sbk_QIconFunc_addFile_TypeError; } else { Py_DECREF(kwds_dup); }
- When the scope ends, since it’s an AutoDecRef, it decrease again and goes bellow 0.
To reproduce:
- Use a debug build.
- Create a QIcon.
- Call the addFile method with named parameters.
In debug, there is an assert check on the counter and it fails when using nameparameters.
It looks like this backport introduce the issue: https://codereview.qt-project.org/c/pyside/tqtc-pyside-setup/+/379410/3/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
Do you confirm this analysis?