mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-10-26 00:43:17 -06:00
fix in the Python binding. The input sentence to the parser needs to be copied since otherwise the Python string may be discarded the garbage collector
This commit is contained in:
1 parent
fe1ce8389c
commit
6947d36e1a
1 file changed
+3
@@ -1429,6 +1429,9 @@ Concr_parse(ConcrObject* self, PyObject *args, PyObject *keywds)
|
||||
pypgf_new_callbacks_map(self->concr, py_callbacks, pyres->pool);
|
||||
if (callbacks == NULL)
|
||||
return NULL;
|
||||
|
||||
sentence = gu_string_copy(sentence, pyres->pool);
|
||||
|
||||
pyres->res =
|
||||
pgf_parse_with_heuristics(self->concr, catname, sentence,
|
||||
heuristics, callbacks, parse_err,
|
||||
|
||||
Reference in new issue
Block a user