src/SubProcess.cpp
branchv_0
changeset 62 a467e8cbd16b
parent 46 b5ae61996281
child 95 f2f2b81079a5
--- a/src/SubProcess.cpp	Sat Jan 25 21:28:37 2020 +0100
+++ b/src/SubProcess.cpp	Sun Jan 26 21:35:02 2020 +0100
@@ -57,7 +57,6 @@
 	void write(string_t s) {
 		subInputWriter << convertor.to_bytes(s).c_str();
 		subInputWriter.put(SEPARATOR);
-		subInputWriter.flush();
 		if (subInputWriter.bad()) throw SubProcess::Exception(L"Unable to write to sub-process.");
 	}
 
@@ -65,6 +64,10 @@
 		write(std::to_wstring(i));
 	}
 
+	void flush() {
+		subInputWriter.flush();
+	}
+
 public:
 
 	/**
@@ -171,6 +174,7 @@
 		write(m.code);
 		write(m.parameters.size());
 		for (auto p : m.parameters) write(p);
+		flush();
 	}
 
 	int wait() {