Catch possible exception when closing non-existent stream

merge-requests/5/head
Phil Taylor 2021-06-02 19:18:44 +01:00
rodzic e4ed41f3d3
commit 0bc3d6adfe
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -27,7 +27,13 @@ audioHandler::~audioHandler()
if (audio != Q_NULLPTR) {
audio->abortStream();
try {
audio->abortStream();
audio->closeStream();
}
catch (RtAudioError& e) {
qInfo(logAudio()) << "Error closing stream:" << aParams.deviceId << ":" << QString::fromStdString(e.getMessage());
}
delete audio;
}