Skip to content

Commit

Permalink
Merge a9efed7 into 44f2321
Browse files Browse the repository at this point in the history
  • Loading branch information
Lord-Kamina committed Sep 10, 2021
2 parents 44f2321 + a9efed7 commit f46ace9
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 f46ace9

Please sign in to comment.