Clementine-audio-player-Mac.../3rdparty/pythonqt/patches/argument-reference-count.patch

16 lines
878 B
Diff

diff --git a/3rdparty/pythonqt/src/PythonQtClassWrapper.cpp b/3rdparty/pythonqt/src/PythonQtClassWrapper.cpp
index 4c3e280..411c7bf 100644
--- a/3rdparty/pythonqt/src/PythonQtClassWrapper.cpp
+++ b/3rdparty/pythonqt/src/PythonQtClassWrapper.cpp
@@ -275,7 +275,9 @@ PyObject *PythonQtClassWrapper__init__(PythonQtClassWrapper *type, PyObject *arg
if (PyObject_TypeCheck(self, (PyTypeObject*)type->classInfo()->pythonQtClassWrapper())) {
PyObject* newargs = PyTuple_New(argc-1);
for (int i = 0;i<argc-1; i++) {
- PyTuple_SET_ITEM(newargs, i,PyTuple_GET_ITEM(args, i+1));
+ PyObject* item = PyTuple_GET_ITEM(args, i+1);
+ Py_INCREF(item);
+ PyTuple_SET_ITEM(newargs, i, item);
}
PythonQtInstanceWrapper* wrapper = (PythonQtInstanceWrapper*)self;
int result = PythonQtInstanceWrapper_init(wrapper, newargs, NULL);