diff --git a/.gitignore b/.gitignore index e0e5c09..d2b6829 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ cmake-build-* .vs .vscode +.VSCodeCounter CMakeSettings.json cmake-build/ diff --git a/actrie/__init__.py b/actrie/__init__.py index b435bd2..2d6c617 100644 --- a/actrie/__init__.py +++ b/actrie/__init__.py @@ -5,4 +5,4 @@ __all__ = ['Matcher', 'Context', 'PrefixMatcher'] -__version__ = '3.0.6' +__version__ = '3.0.7' diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index e69de29..0000000 diff --git a/src/matcher.c b/src/matcher.c index 1c8777a..4c9e07a 100644 --- a/src/matcher.c +++ b/src/matcher.c @@ -33,6 +33,12 @@ static void add_pattern_to_matcher(ptrn_t pattern, strlen_t extra, void* arg) { static void free_expr_list(void* trie, void* node) { list_t list = (list_t)node; + while (list != NULL) { + // NOTE: car of list is expr_t, and it is not aobj!!! + list->car = NULL; + list = list->cdr; + } + list = (list_t)node; _release(list); } @@ -74,8 +80,8 @@ matcher_t matcher_construct_by_string(strlen_t string, bool all_as_plain, bool i void matcher_destruct(matcher_t matcher) { if (matcher != NULL) { - reglet_destruct(matcher->reglet); dat_destruct(matcher->datrie, (dat_node_free_f)free_expr_list); + reglet_destruct(matcher->reglet); matcher_free(matcher); } }