Skip to content
Permalink
Browse files

Fix some leaks in conversions

(cherry-picked from 273e664)
  • Loading branch information
nyalldawson committed Mar 15, 2018
1 parent 5bea05f commit 60f0a23501829dca5dcaac0c130f8bcf2ed5cc7a
Showing with 4 additions and 4 deletions.
  1. +4 −4 python/core/conversions.sip
@@ -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;
@@ -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;
@@ -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;
@@ -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)
{

0 comments on commit 60f0a23

Please sign in to comment.
You can’t perform that action at this time.