Cleanup accessing/decref of globals, to avoid code bloat in init function.
This commit is contained in:
parent
3c090307a4
commit
0fecd1538f
2 changed files with 13 additions and 18 deletions
|
|
@ -227,11 +227,7 @@ SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void
|
|||
SWIGINTERN PyObject *
|
||||
SWIG_globals(void) {
|
||||
static PyObject *_SWIG_globals = 0;
|
||||
if (!_SWIG_globals) {
|
||||
_SWIG_globals = SWIG_newvarlink();
|
||||
} else {
|
||||
Py_INCREF(_SWIG_globals);
|
||||
}
|
||||
if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();
|
||||
return _SWIG_globals;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue