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