output/Control: move code from FinishDestroy() to destructor
This commit is contained in:
parent
a5b93008f5
commit
7574dfd339
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue