diff --git a/src/runtime/c/pgf/namespace.h b/src/runtime/c/pgf/namespace.h index 96faab9cd..2a0b2c694 100644 --- a/src/runtime/c/pgf/namespace.h +++ b/src/runtime/c/pgf/namespace.h @@ -287,7 +287,7 @@ Namespace namespace_insert(Namespace map, ref value) return Node::new_node(value,map->left,map->right); } } - + template ref namespace_lookup(Namespace map, PgfText *name) { diff --git a/src/runtime/c/pgf/pgf.h b/src/runtime/c/pgf/pgf.h index d8f2c31d5..7ede7d942 100644 --- a/src/runtime/c/pgf/pgf.h +++ b/src/runtime/c/pgf/pgf.h @@ -247,6 +247,9 @@ void pgf_free(PgfDB *pgf); PGF_API_DECL void pgf_free_revision(PgfDB *pgf, PgfRevision revision); +/* Returns a newly allocated text which contains the abstract name of + * the grammar. The text must be released with a call to free. + */ PGF_API_DECL PgfText *pgf_abstract_name(PgfDB *db, PgfRevision revision, PgfExn* err); diff --git a/src/runtime/python/pypgf.c b/src/runtime/python/pypgf.c index e04ce4076..39baec9ec 100644 --- a/src/runtime/python/pypgf.c +++ b/src/runtime/python/pypgf.c @@ -1777,6 +1777,7 @@ PGF_getAbstractName(PGFObject *self, void *closure) } PyObject *name = PyString_FromStringAndSize(txt->text, txt->size); + free(txt); return name; }