File tree 2 files changed +11
-7
lines changed
2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -71,9 +71,8 @@ void PythonQt_init_QtCoreBuiltin(PyObject*);
71
71
static inline int PyModule_AddObject_DECREF (PyObject *module, const char *name, PyObject *value)
72
72
{
73
73
int ret = PyModule_AddObject (module, name, value);
74
- if (ret < 0 ) {
74
+ if (ret < 0 )
75
75
Py_XDECREF (value);
76
- }
77
76
return ret;
78
77
}
79
78
@@ -2147,9 +2146,8 @@ const QMetaObject* PythonQtPrivate::buildDynamicMetaObject(PythonQtClassWrapper*
2147
2146
PyObject* value = NULL ;
2148
2147
PyObject* key = NULL ;
2149
2148
static PyObject* qtSlots = NULL ;
2150
- if (!qtSlots) {
2151
- qtSlots = PyString_FromString (" _qtSlots" );
2152
- }
2149
+ if (!qtSlots)
2150
+ qtSlots = PyString_FromString (" _qtSlots" );
2153
2151
2154
2152
bool needsMetaObject = false ;
2155
2153
// Iterate over all members and check if they affect the QMetaObject:
Original file line number Diff line number Diff line change @@ -224,9 +224,9 @@ PythonQtImporter_load_module(PyObject *obj, PyObject *args)
224
224
PyObject *code = NULL , *mod = NULL , *dict = NULL ;
225
225
char *fullname;
226
226
227
- if (!PyArg_ParseTuple (args, " s:PythonQtImporter.load_module" , &fullname)) {
227
+ if (!PyArg_ParseTuple (args, " s:PythonQtImporter.load_module" ,
228
+ &fullname))
228
229
return NULL ;
229
- }
230
230
231
231
PythonQtImport::ModuleInfo info = PythonQtImport::getModuleInfo (self, fullname);
232
232
if (info.type == PythonQtImport::MI_NOT_FOUND) {
@@ -250,6 +250,7 @@ PythonQtImporter_load_module(PyObject *obj, PyObject *args)
250
250
251
251
if (PyDict_SetItemString (dict, " __loader__" , (PyObject *)self) != 0 ) {
252
252
Py_DECREF (code);
253
+ Py_DECREF (mod);
253
254
return NULL ;
254
255
}
255
256
@@ -264,19 +265,22 @@ PythonQtImporter_load_module(PyObject *obj, PyObject *args)
264
265
QStringToPythonConstCharPointer (subname));
265
266
if (fullpath == NULL ) {
266
267
Py_DECREF (code);
268
+ Py_DECREF (mod);
267
269
return NULL ;
268
270
}
269
271
270
272
pkgpath = Py_BuildValue (" [O]" , fullpath);
271
273
Py_DECREF (fullpath);
272
274
if (pkgpath == NULL ) {
273
275
Py_DECREF (code);
276
+ Py_DECREF (mod);
274
277
return NULL ;
275
278
}
276
279
err = PyDict_SetItemString (dict, " __path__" , pkgpath);
277
280
Py_DECREF (pkgpath);
278
281
if (err != 0 ) {
279
282
Py_DECREF (code);
283
+ Py_DECREF (mod);
280
284
return NULL ;
281
285
}
282
286
@@ -290,10 +294,12 @@ PythonQtImporter_load_module(PyObject *obj, PyObject *args)
290
294
Py_XDECREF (fullnameObj);
291
295
if (err != 0 ) {
292
296
Py_DECREF (code);
297
+ Py_DECREF (mod);
293
298
return NULL ;
294
299
}
295
300
#endif
296
301
}
302
+ Py_DECREF (mod);
297
303
298
304
#ifdef PY3K
299
305
PyObject* fullnameObj = PyUnicode_FromString (fullname);
You can’t perform that action at this time.
0 commit comments