Skip to content

Commit

Permalink
Wait for remaining bytes to be written to solns2out process when solv…
Browse files Browse the repository at this point in the history
…er process has finished. Fixes #10.
  • Loading branch information
guidotack committed Mar 26, 2016
1 parent 5605226 commit 8cbed2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions MiniZincIDE/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1875,7 +1875,9 @@ void MainWindow::procFinished(int, bool showTime) {
process = NULL;
if (outputProcess) {
outputProcess->closeWriteChannel();
outputProcess->waitForBytesWritten();
outputProcess->waitForFinished();
readOutput();
outputProcess = NULL;
finishJSONViewer();
inJSONHandler = false;
Expand Down
2 changes: 1 addition & 1 deletion MiniZincIDE/solverdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ void MznProcess::start(const QString &program, const QStringList &arguments, con
#else
setenv("PATH", (addPath + pathSep + curPath).toStdString().c_str(), 1);
#endif
QProcess::start(program,arguments);
QProcess::start(program,arguments, QIODevice::Unbuffered | QIODevice::ReadWrite);
#ifdef Q_OS_WIN
_putenv_s("PATH", curPath.toStdString().c_str());
#else
Expand Down

0 comments on commit 8cbed2b

Please sign in to comment.