From 791a08363aaf400e4269510e8730e73098812460 Mon Sep 17 00:00:00 2001 From: Henk Kalkwater Date: Mon, 29 Jun 2020 23:51:40 +0200 Subject: [PATCH] Properly wait for spawned processes to end --- source/page.d | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/page.d b/source/page.d index c347db1..684346b 100644 --- a/source/page.d +++ b/source/page.d @@ -111,15 +111,20 @@ class Page { pandoc.stdin.writeln(); pandoc.stdin.flush(); pandoc.stdin.close(); + pandoc.pid.wait(); string result; string line; while ((line = pandoc.stdout.readln()) !is null) { result ~= line; - logf("Pandoc stdout: %s", line); + debug { + logf("Pandoc stdout: %s", line); + } } while ((line = pandoc.stderr.readln()) !is null) { - logf("Pandoc stderr: %s", line); + debug { + logf("Pandoc stderr: %s", line); + } } return result;