diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2013-06-14 07:02:53 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2013-06-14 07:02:53 +0000 |
| commit | b0b4f5777590d24ea235443ff6d7e370efb144a4 (patch) | |
| tree | 56e9329c9c7e2ba889d08c1acf35fc434a91a549 | |
| parent | bdfd663e917b0d5ed1a2d987f2f470c682969dd3 (diff) | |
bugfix in the python binding
| -rw-r--r-- | src/runtime/python/pypgf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runtime/python/pypgf.c b/src/runtime/python/pypgf.c index 698b48ec9..8acfcf451 100644 --- a/src/runtime/python/pypgf.c +++ b/src/runtime/python/pypgf.c @@ -457,7 +457,7 @@ Iter_fetch_expr(IterObject* self) pyexpr->pool = NULL; pyexpr->expr = ep->expr; pyexpr->master = self->container; - Py_INCREF(self->container); + Py_XINCREF(self->container); PyObject* res = Py_BuildValue("(f,O)", ep->prob, pyexpr); Py_DECREF(pyexpr); @@ -1508,6 +1508,7 @@ PGF_generate(PGFObject* self, PyObject *args, PyObject *keywds) pyres->max_count = max_count; pyres->counter = 0; pyres->fetch = Iter_fetch_expr; + pyres->container = (PyObject*) pyres; GuPool *tmp_pool = gu_local_pool(); GuString catname = gu_str_string(catname_s, tmp_pool); |
