summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkrangelov <kr.angelov@gmail.com>2022-08-12 10:51:56 +0200
committerkrangelov <kr.angelov@gmail.com>2022-08-12 10:51:56 +0200
commit08fb29e6b846e24f9f1e4de21e05d220bdf54624 (patch)
tree4693670c3a9dd20e2ed30a2158e9406723df16ce /src
parentf69babef6d6a496dfea2896859a897baddf853eb (diff)
fix the reference counting for pgf.BIND
Diffstat (limited to 'src')
-rw-r--r--src/runtime/python/pypgf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/python/pypgf.c b/src/runtime/python/pypgf.c
index 941986593..e6df2632b 100644
--- a/src/runtime/python/pypgf.c
+++ b/src/runtime/python/pypgf.c
@@ -1184,6 +1184,8 @@ BIND_alloc(PyTypeObject *self, Py_ssize_t nitems)
{
if (BIND_instance == NULL)
BIND_instance = PyType_GenericAlloc(self, nitems);
+ else
+ Py_INCREF(BIND_instance);
return BIND_instance;
}
@@ -1720,6 +1722,7 @@ Concr_complete(ConcrObject* self, PyObject *args, PyObject *keywds)
sentence = PyUnicode_AsUTF8(sentence0);
} else {
PyErr_SetString(PyExc_TypeError, "The sentence must be either a string or a tuple of string and pgf.BIND");
+ return NULL;
}
PgfType* type;