mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
Fix OutputFileRedirector destructor ordering.
This commit is contained in:
parent
10459a76f7
commit
a560a9f827
@ -228,16 +228,16 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
OutputFileRedirector::~OutputFileRedirector() noexcept {
|
OutputFileRedirector::~OutputFileRedirector() noexcept {
|
||||||
if ( m_readThread.joinable() ) {
|
|
||||||
m_readThread.join();
|
|
||||||
}
|
|
||||||
|
|
||||||
fflush_or_throw(
|
fflush_or_throw(
|
||||||
m_file ); // std::terminate on failure (due to noexcept)
|
m_file ); // std::terminate on failure (due to noexcept)
|
||||||
|
|
||||||
// Restore the original stdout or stderr file descriptor.
|
// Restore the original stdout or stderr file descriptor.
|
||||||
dup2_or_throw( m_previous.get(),
|
dup2_or_throw( m_previous.get(),
|
||||||
m_fd ); // std::terminate on failure (due to noexcept)
|
m_fd ); // std::terminate on failure (due to noexcept)
|
||||||
|
|
||||||
|
if ( m_readThread.joinable() ) {
|
||||||
|
m_readThread.join();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputRedirect::OutputRedirect( std::string& output, std::string& error ):
|
OutputRedirect::OutputRedirect( std::string& output, std::string& error ):
|
||||||
|
Loading…
Reference in New Issue
Block a user