diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2022-07-01 14:02:28 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-01 11:02:28 -0700 |
| commit | b0ea5ed4da709312910898fa03b4dafc7a27e358 (patch) | |
| tree | 70adea35a369d43bea79d71dcb2f8758772562aa /source/core/slang-writer.cpp | |
| parent | 65cd44d54cc76d78777cde5f8a02b485056249f3 (diff) | |
Fix for issue with redirecting stdout/err to a file (#2311)
Diffstat (limited to 'source/core/slang-writer.cpp')
| -rw-r--r-- | source/core/slang-writer.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/core/slang-writer.cpp b/source/core/slang-writer.cpp index 849cb2da0..2b00b5853 100644 --- a/source/core/slang-writer.cpp +++ b/source/core/slang-writer.cpp @@ -127,9 +127,14 @@ SlangResult CallbackWriter::write(const char* chars, size_t numChars) FileWriter::~FileWriter() { - if ((m_flags & WriterFlag::IsUnowned) == 0) + if (m_file) { - fclose(m_file); + ::fflush(m_file); + + if ((m_flags & WriterFlag::IsUnowned) == 0) + { + ::fclose(m_file); + } } } |
