mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-20 16:42:51 -06:00
fix the reference counting for pgf.BIND
This commit is contained in:
@@ -1184,6 +1184,8 @@ BIND_alloc(PyTypeObject *self, Py_ssize_t nitems)
|
|||||||
{
|
{
|
||||||
if (BIND_instance == NULL)
|
if (BIND_instance == NULL)
|
||||||
BIND_instance = PyType_GenericAlloc(self, nitems);
|
BIND_instance = PyType_GenericAlloc(self, nitems);
|
||||||
|
else
|
||||||
|
Py_INCREF(BIND_instance);
|
||||||
return BIND_instance;
|
return BIND_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1720,6 +1722,7 @@ Concr_complete(ConcrObject* self, PyObject *args, PyObject *keywds)
|
|||||||
sentence = PyUnicode_AsUTF8(sentence0);
|
sentence = PyUnicode_AsUTF8(sentence0);
|
||||||
} else {
|
} else {
|
||||||
PyErr_SetString(PyExc_TypeError, "The sentence must be either a string or a tuple of string and pgf.BIND");
|
PyErr_SetString(PyExc_TypeError, "The sentence must be either a string or a tuple of string and pgf.BIND");
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
PgfType* type;
|
PgfType* type;
|
||||||
|
|||||||
Reference in New Issue
Block a user