Skip to content

Commit

Permalink
Added fflush call to end of ProgressFeedback functions as stderr was …
Browse files Browse the repository at this point in the history
…being buffered when using with C# Process object and I couldn't get realtime progress feedback
  • Loading branch information
jamyspex authored and ashkulz committed Aug 1, 2017
1 parent 6f755a8 commit 147b9f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/shared/progressfeedback.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ void ProgressFeedback::warning(const QString &message) {
fprintf(stderr, " ");
fprintf(stderr, "\n");
lw = 0;
fflush(stderr);
}

/*!
Expand All @@ -57,6 +58,7 @@ void ProgressFeedback::error(const QString &message) {
fprintf(stderr, " ");
fprintf(stderr, "\n");
lw = 0;
fflush(stderr);
}

/*!
Expand All @@ -74,6 +76,7 @@ void ProgressFeedback::phaseChanged() {
fprintf(stderr, " ");
fprintf(stderr, "\n");
lw = 0;
fflush(stderr);
}

/*!
Expand All @@ -96,6 +99,7 @@ void ProgressFeedback::progressChanged(int progress) {
for (int i=l; i < lw; ++i) fprintf(stderr, " ");
lw = l;
fprintf(stderr, "\r");
fflush(stderr);
}

ProgressFeedback::ProgressFeedback(settings::LogLevel l, Converter & _):
Expand Down

0 comments on commit 147b9f1

Please sign in to comment.