Python singletons tidy up

This commit is contained in:
William S Fulton 2018-07-17 20:23:55 +01:00
commit 344e9fefa8

View file

@ -251,17 +251,15 @@ extern "C" {
# undef Py_None # undef Py_None
# define Py_None SWIG_Py_None() # define Py_None SWIG_Py_None()
# endif # endif
SWIGRUNTIMEINLINE PyObject *
_SWIG_Py_None(void)
{
PyObject *none = Py_BuildValue("");
Py_DECREF(none);
return none;
}
SWIGRUNTIME PyObject * SWIGRUNTIME PyObject *
SWIG_Py_None(void) SWIG_Py_None(void)
{ {
static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); static PyObject *none = NULL;
if (!none == NULL) {
none = Py_BuildValue("");
Py_DECREF(none);
}
return none; return none;
} }
#endif #endif
@ -976,20 +974,14 @@ SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
* pointers/data manipulation * pointers/data manipulation
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
SWIGRUNTIMEINLINE PyObject * static PyObject *Swig_This_global = NULL;
_SWIG_This(void)
{
return SWIG_Python_str_FromChar("this");
}
static PyObject *swig_this = NULL;
SWIGRUNTIME PyObject * SWIGRUNTIME PyObject *
SWIG_This(void) SWIG_This(void)
{ {
if (swig_this == NULL) if (Swig_This_global == NULL)
swig_this = _SWIG_This(); Swig_This_global = SWIG_Python_str_FromChar("this");
return swig_this; return Swig_This_global;
} }
/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
@ -1418,7 +1410,7 @@ SWIG_Python_DestroyModule(PyObject *obj)
} }
} }
Py_DECREF(SWIG_This()); Py_DECREF(SWIG_This());
swig_this = NULL; Swig_This_global = NULL;
} }
SWIGRUNTIME void SWIGRUNTIME void