Clean shutdown, stability

This commit is contained in:
Robin Davies
2024-09-21 13:18:00 -04:00
parent 951a7a73de
commit 2b13dc1c96
30 changed files with 820 additions and 358 deletions
+8 -10
View File
@@ -349,17 +349,14 @@ private:
virtual void Close()
{
std::lock_guard guard{mutex};
if (!isOpen)
return;
isOpen = false;
if (realtimeMonitorPortSubscriptions != nullptr)
{
delete realtimeMonitorPortSubscriptions;
realtimeMonitorPortSubscriptions = nullptr;
std::lock_guard guard{mutex};
if (!isOpen)
return;
isOpen = false;
}
if (active)
{
audioDriver->Deactivate();
@@ -371,6 +368,7 @@ private:
StopReaderThread();
// release any pdealboards owned by the process thread.
this->activePedalboards.resize(0);
this->realtimeActivePedalboard = nullptr;
@@ -815,7 +813,7 @@ private:
virtual void OnAudioTerminated() override
{
this->active = false;
Lv2Log::info("Audio stopped.");
Lv2Log::info("Audio thread terminated.");
}