Skip to content

Commit

Permalink
Merge 53c4819 into a66d7e9
Browse files Browse the repository at this point in the history
  • Loading branch information
Lord-Kamina committed Apr 3, 2022
2 parents a66d7e9 + 53c4819 commit 78e0a6e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions game/libda/portaudio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,7 @@ namespace portaudio {
}
~Stream() {
if (!m_handle) return;
// Give audio a little time to shutdown but then just quit
auto audiokiller = std::async(std::launch::async, Pa_CloseStream, m_handle);
if (audiokiller.wait_for(std::chrono::seconds(5)) == std::future_status::ready) return;
std::cerr << "PortAudio BUG: Pa_CloseStream hung for more than five seconds. Aborting." << std::endl;
abort(); // Crash. Calling exit() is prone to hang.
PORTAUDIO_CHECKED(Pa_CloseStream, (m_handle));
}
operator PaStream*() { return m_handle; }
};
Expand Down

0 comments on commit 78e0a6e

Please sign in to comment.