diff --git a/src/runtime/c/utils/pgf-parse.c b/src/runtime/c/utils/pgf-parse.c index 991a16361..182ed31b4 100644 --- a/src/runtime/c/utils/pgf-parse.c +++ b/src/runtime/c/utils/pgf-parse.c @@ -79,6 +79,12 @@ int main(int argc, char* argv[]) { // XXX: This currently reads stdin directly, so it doesn't support // encodings properly. TODO: use a locale reader for input for (int ctr = 0; true; ctr++) { + // We release the last results + if (ppool != NULL) { + gu_pool_free(ppool); + ppool = NULL; + } + /* fprintf(stdout, "> "); */ /* fflush(stdout); */ char buf[4096]; @@ -97,12 +103,6 @@ int main(int argc, char* argv[]) { continue; } - // We release the last results - if (ppool != NULL) { - gu_pool_free(ppool); - ppool = NULL; - } - // We create a temporary pool for translating a single // sentence, so our memory usage doesn't increase over time. ppool = gu_new_pool();