Re-order audio handler destructors

monitor
Phil Taylor 2022-07-05 10:37:10 +01:00
rodzic bcc16b8d29
commit ac2c104209
3 zmienionych plików z 16 dodań i 16 usunięć

Wyświetl plik

@ -18,23 +18,24 @@ audioHandler::audioHandler(QObject* parent) : QObject(parent)
audioHandler::~audioHandler()
{
if (converterThread != Q_NULLPTR) {
converterThread->quit();
converterThread->wait();
}
if (isInitialized) {
stop();
}
if (audioInput != Q_NULLPTR) {
audioInput = Q_NULLPTR;
delete audioInput;
audioInput = Q_NULLPTR;
}
if (audioOutput != Q_NULLPTR) {
delete audioOutput;
audioOutput = Q_NULLPTR;
}
if (converterThread != Q_NULLPTR) {
converterThread->quit();
converterThread->wait();
}
}bool audioHandler::init(audioSetup setup)
{
if (isInitialized) {

Wyświetl plik

@ -15,17 +15,15 @@ paHandler::paHandler(QObject* parent)
paHandler::~paHandler()
{
if (isInitialized) {
Pa_StopStream(audio);
Pa_CloseStream(audio);
}
if (converterThread != Q_NULLPTR) {
converterThread->quit();
converterThread->wait();
}
//Pa_Terminate();
if (isInitialized) {
Pa_StopStream(audio);
Pa_CloseStream(audio);
}
}

Wyświetl plik

@ -16,7 +16,13 @@ rtHandler::rtHandler(QObject* parent)
rtHandler::~rtHandler()
{
if (converterThread != Q_NULLPTR) {
converterThread->quit();
converterThread->wait();
}
if (isInitialized) {
#ifdef RT_EXCEPTION
try {
#endif
@ -31,11 +37,6 @@ rtHandler::~rtHandler()
delete audio;
}
if (converterThread != Q_NULLPTR) {
converterThread->quit();
converterThread->wait();
}
}