Commit 7574dfd3 authored by Max Kellermann's avatar Max Kellermann

output/Control: move code from FinishDestroy() to destructor

parent a5b93008
......@@ -46,10 +46,8 @@ AudioOutputControl::AudioOutputControl(std::unique_ptr<FilteredAudioOutput> _out
AudioOutputControl::~AudioOutputControl() noexcept
{
assert(!fail_timer.IsDefined());
assert(!thread.IsDefined());
assert(output == nullptr);
assert(!open);
if (thread.IsDefined())
thread.Join();
}
void
......@@ -376,12 +374,3 @@ AudioOutputControl::BeginDestroy() noexcept
CommandAsync(Command::KILL);
}
}
void
AudioOutputControl::FinishDestroy() noexcept
{
if (thread.IsDefined())
thread.Join();
output.reset();
}
......@@ -317,7 +317,6 @@ public:
void LockCommandWait(Command cmd) noexcept;
void BeginDestroy() noexcept;
void FinishDestroy() noexcept;
const std::map<std::string, std::string> GetAttributes() const noexcept;
void SetAttribute(std::string &&name, std::string &&value);
......
......@@ -46,8 +46,6 @@ MultipleOutputs::~MultipleOutputs() noexcept
for (auto *i : outputs)
i->BeginDestroy();
for (auto *i : outputs)
i->FinishDestroy();
for (auto *i : outputs)
delete i;
}
......@@ -82,7 +80,6 @@ LoadOutputControl(EventLoop &event_loop,
control->Configure(block);
} catch (...) {
control->BeginDestroy();
control->FinishDestroy();
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