From 0102b2028970dd8d6af000904d6a312d4d163a99 Mon Sep 17 00:00:00 2001 From: Andrew Davison Date: Sun, 3 Nov 2024 21:47:48 +1000 Subject: [PATCH] end_of_file, re issue #620 --- src/prolog.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/prolog.c b/src/prolog.c index f0698cb7..92687f09 100644 --- a/src/prolog.c +++ b/src/prolog.c @@ -153,16 +153,14 @@ bool pl_query(prolog *pl, const char *s, pl_sub_query **subq, unsigned int yield if (!pl || !*s || !subq) return false; - if (!pl->p) - pl->p = parser_create(pl->curr_m); - else - reset(pl->p); - + pl->p = parser_create(pl->curr_m); if (!pl->p) return false; pl->p->command = true; pl->is_query = true; bool ok = run(pl->p, s, true, (query**)subq, yield_time_in_ms); if (get_status(pl)) pl->curr_m = pl->p->m; + parser_destroy(pl->p); + pl->p = NULL; return ok; }