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

This commit is contained in:
Max Kellermann 2018-01-04 10:34:27 +01:00
parent a5b93008f5
commit 7574dfd339
3 changed files with 2 additions and 17 deletions

View File

@ -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();
}

View File

@ -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);

View File

@ -45,8 +45,6 @@ MultipleOutputs::~MultipleOutputs() noexcept
/* parallel destruction */
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;
}