Skip to content

Commit

Permalink
Fix some leaks in conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 12, 2018
1 parent a0f6a2b commit 273e664
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/core/conversions.sip
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ template <TYPE>
QVector<TYPE> *t = new QVector<TYPE>(sipCpp->at(i));
PyObject *tobj;

if ((tobj = sipConvertFromMappedType(t, qvector_type, sipTransferObj)) == NULL)
if ((tobj = sipConvertFromNewType(t, qvector_type, NULL)) == NULL)
{
Py_DECREF(l);
delete t;
Expand Down Expand Up @@ -126,7 +126,7 @@ template <TYPE>
QVector<QVector<TYPE> > *t = new QVector<QVector<TYPE> >(sipCpp->at(i));
PyObject *tobj;

if ((tobj = sipConvertFromMappedType(t, qvector_type, sipTransferObj)) == NULL)
if ((tobj = sipConvertFromNewType(t, qvector_type, NULL)) == NULL)
{
Py_DECREF(l);
delete t;
Expand Down Expand Up @@ -202,7 +202,7 @@ template <TYPE>
QList<TYPE> *t = new QList<TYPE>(sipCpp->at(i));
PyObject *tobj;

if ((tobj = sipConvertFromMappedType(t, qlist_type, sipTransferObj)) == NULL)
if ((tobj = sipConvertFromNewType(t, qlist_type, NULL)) == NULL)
{
Py_DECREF(l);
delete t;
Expand Down Expand Up @@ -470,7 +470,7 @@ template<TYPE>
QMap<int, TYPE> *t = new QMap<int, TYPE>(*it);

PyObject *kobj = PyLong_FromLongLong(it.key());
PyObject *tobj = sipConvertFromMappedType(t, qmap2, sipTransferObj);
PyObject *tobj = sipConvertFromNewType(t, qmap2, sipTransferObj);

if (kobj == NULL || tobj == NULL || PyDict_SetItem(d, kobj, tobj) < 0)
{
Expand Down

0 comments on commit 273e664

Please sign in to comment.