Properly wait for spawned processes to end
This commit is contained in:
parent
76b3ca0d33
commit
791a08363a
|
@ -111,15 +111,20 @@ class Page {
|
||||||
pandoc.stdin.writeln();
|
pandoc.stdin.writeln();
|
||||||
pandoc.stdin.flush();
|
pandoc.stdin.flush();
|
||||||
pandoc.stdin.close();
|
pandoc.stdin.close();
|
||||||
|
pandoc.pid.wait();
|
||||||
string result;
|
string result;
|
||||||
string line;
|
string line;
|
||||||
while ((line = pandoc.stdout.readln()) !is null) {
|
while ((line = pandoc.stdout.readln()) !is null) {
|
||||||
result ~= line;
|
result ~= line;
|
||||||
logf("Pandoc stdout: %s", line);
|
debug {
|
||||||
|
logf("Pandoc stdout: %s", line);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((line = pandoc.stderr.readln()) !is null) {
|
while ((line = pandoc.stderr.readln()) !is null) {
|
||||||
logf("Pandoc stderr: %s", line);
|
debug {
|
||||||
|
logf("Pandoc stderr: %s", line);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue