Commit b42f19f5 authored by Max Kellermann's avatar Max Kellermann

output/Control: implicitly call BeginDestroy() in destructor

parent 92022658
......@@ -42,6 +42,8 @@ AudioOutputControl::AudioOutputControl(std::unique_ptr<FilteredAudioOutput> _out
AudioOutputControl::~AudioOutputControl() noexcept
{
BeginDestroy();
if (thread.IsDefined())
thread.Join();
}
......@@ -378,6 +380,7 @@ AudioOutputControl::BeginDestroy() noexcept
{
if (thread.IsDefined()) {
const std::lock_guard<Mutex> protect(mutex);
CommandAsync(Command::KILL);
if (IsCommandFinished())
CommandAsync(Command::KILL);
}
}
......@@ -84,7 +84,6 @@ LoadOutputControl(EventLoop &event_loop,
try {
control->Configure(block);
} catch (...) {
control->BeginDestroy();
delete control;
throw;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment