output/Control: move code from FinishDestroy() to destructor
This commit is contained in:
@@ -46,10 +46,8 @@ AudioOutputControl::AudioOutputControl(std::unique_ptr<FilteredAudioOutput> _out
|
|||||||
|
|
||||||
AudioOutputControl::~AudioOutputControl() noexcept
|
AudioOutputControl::~AudioOutputControl() noexcept
|
||||||
{
|
{
|
||||||
assert(!fail_timer.IsDefined());
|
if (thread.IsDefined())
|
||||||
assert(!thread.IsDefined());
|
thread.Join();
|
||||||
assert(output == nullptr);
|
|
||||||
assert(!open);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -376,12 +374,3 @@ AudioOutputControl::BeginDestroy() noexcept
|
|||||||
CommandAsync(Command::KILL);
|
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 LockCommandWait(Command cmd) noexcept;
|
||||||
|
|
||||||
void BeginDestroy() noexcept;
|
void BeginDestroy() noexcept;
|
||||||
void FinishDestroy() noexcept;
|
|
||||||
|
|
||||||
const std::map<std::string, std::string> GetAttributes() const noexcept;
|
const std::map<std::string, std::string> GetAttributes() const noexcept;
|
||||||
void SetAttribute(std::string &&name, std::string &&value);
|
void SetAttribute(std::string &&name, std::string &&value);
|
||||||
|
@@ -45,8 +45,6 @@ MultipleOutputs::~MultipleOutputs() noexcept
|
|||||||
/* parallel destruction */
|
/* parallel destruction */
|
||||||
for (auto *i : outputs)
|
for (auto *i : outputs)
|
||||||
i->BeginDestroy();
|
i->BeginDestroy();
|
||||||
for (auto *i : outputs)
|
|
||||||
i->FinishDestroy();
|
|
||||||
for (auto *i : outputs)
|
for (auto *i : outputs)
|
||||||
delete i;
|
delete i;
|
||||||
}
|
}
|
||||||
@@ -82,7 +80,6 @@ LoadOutputControl(EventLoop &event_loop,
|
|||||||
control->Configure(block);
|
control->Configure(block);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
control->BeginDestroy();
|
control->BeginDestroy();
|
||||||
control->FinishDestroy();
|
|
||||||
delete control;
|
delete control;
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user