output/Control: implicitly call BeginDestroy() in destructor
This commit is contained in:
parent
92022658f9
commit
b42f19f514
@ -42,6 +42,8 @@ AudioOutputControl::AudioOutputControl(std::unique_ptr<FilteredAudioOutput> _out
|
|||||||
|
|
||||||
AudioOutputControl::~AudioOutputControl() noexcept
|
AudioOutputControl::~AudioOutputControl() noexcept
|
||||||
{
|
{
|
||||||
|
BeginDestroy();
|
||||||
|
|
||||||
if (thread.IsDefined())
|
if (thread.IsDefined())
|
||||||
thread.Join();
|
thread.Join();
|
||||||
}
|
}
|
||||||
@ -378,6 +380,7 @@ AudioOutputControl::BeginDestroy() noexcept
|
|||||||
{
|
{
|
||||||
if (thread.IsDefined()) {
|
if (thread.IsDefined()) {
|
||||||
const std::lock_guard<Mutex> protect(mutex);
|
const std::lock_guard<Mutex> protect(mutex);
|
||||||
|
if (IsCommandFinished())
|
||||||
CommandAsync(Command::KILL);
|
CommandAsync(Command::KILL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,6 @@ LoadOutputControl(EventLoop &event_loop,
|
|||||||
try {
|
try {
|
||||||
control->Configure(block);
|
control->Configure(block);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
control->BeginDestroy();
|
|
||||||
delete control;
|
delete control;
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user