Closed mavxg closed 5 months ago
Looks okay to me, and it does appear to plug the leak. Thanks!
Should we include the Py_XDECREF call from here as well?
(My C++ skills are way too rusty to accept this PR myself.)
Yes. It fixes another leak for the first row/tuple in the sequence. For TVP, BindParameters is getting just the first row (not sure what the reason behind the PySequence_Size(info.pObject) - info.ColumnSize
to get the first item in the sequence). PyObject *param = PySequence_GetItem(row, i);
will increase the ref count of the items in the first tuple in the sequence and the Py_XDECREF would then decrease it again.
Fixes #1338