Skip to content

Commit

Permalink
fixed memory bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
ifplusor committed Nov 17, 2017
1 parent c3f492b commit e436dcd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions actrie/src/wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,11 @@ PyObject *wrap_find_all(PyObject *dummy, PyObject *args) {
while (next(wctx)) {
PyObject *item = build_matched_output(wctx);
PyList_Append(list, item);
Py_DECREF(item);
}

free_context(wctx);

return list;
}

Expand Down
2 changes: 1 addition & 1 deletion actrie/tests/test_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test():
print(matched)

print("\ntest find all")
ret = matcher.find_all(content)
ret = matcher.findall(content)
print(ret)


Expand Down

0 comments on commit e436dcd

Please sign in to comment.