File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -22,15 +22,17 @@ typedef QVector<QVariant> QgsAttributes;
22
22
// Set the list elements.
23
23
for (int i = 0; i < sipCpp->size(); ++i)
24
24
{
25
- QVariant* v = new QVariant(sipCpp->at(i));
25
+ QVariant* v = new QVariant( sipCpp->at(i) );
26
26
PyObject *tobj;
27
27
28
28
if ( v->isNull() )
29
29
{
30
30
tobj = Py_None;
31
+ delete v;
31
32
}
32
- else if ((tobj = sipConvertFromType (v, sipType_QVariant,Py_None)) == NULL)
33
+ else if ((tobj = sipConvertFromNewType (v, sipType_QVariant,Py_None)) == NULL)
33
34
{
35
+ delete v;
34
36
return NULL;
35
37
}
36
38
@@ -200,11 +202,16 @@ class QgsFeature
200
202
}
201
203
else
202
204
{
203
- QVariant* v = new QVariant(attrs[a0] );
205
+ QVariant* v = new QVariant(attrs.at(a0) );
204
206
if ( v->isNull() )
207
+ {
208
+ delete v;
205
209
sipRes = Py_None;
210
+ }
206
211
else
207
- sipRes = sipConvertFromInstance( v, sipClass_QVariant, Py_None );
212
+ {
213
+ sipRes = sipConvertFromNewInstance( v, sipClass_QVariant, Py_None );
214
+ }
208
215
}
209
216
%End
210
217
You can’t perform that action at this time.
0 commit comments