Incref an object which will be held forever in a static var

This commit is contained in:
Daniele Varrazzo 2019-01-23 09:28:26 +00:00
parent e9c476266c
commit 66d5c6da07

View File

@ -278,6 +278,7 @@ typecast_init(PyObject *dict)
/* export binary object */ /* export binary object */
if (typecast_builtins[i].values == typecast_BINARY_types) { if (typecast_builtins[i].values == typecast_BINARY_types) {
Py_INCREF((PyObject *)t);
psyco_default_binary_cast = (PyObject *)t; psyco_default_binary_cast = (PyObject *)t;
} }
Py_DECREF((PyObject *)t); Py_DECREF((PyObject *)t);