output/Control: move code to method StopThread()

This commit is contained in:
Max Kellermann 2020-01-18 21:16:51 +01:00
parent 37f984ba74
commit 7732db0aee
2 changed files with 14 additions and 4 deletions

View File

@ -38,10 +38,7 @@ AudioOutputControl::AudioOutputControl(std::unique_ptr<FilteredAudioOutput> _out
AudioOutputControl::~AudioOutputControl() noexcept AudioOutputControl::~AudioOutputControl() noexcept
{ {
BeginDestroy(); StopThread();
if (thread.IsDefined())
thread.Join();
} }
void void
@ -383,3 +380,14 @@ AudioOutputControl::BeginDestroy() noexcept
} }
} }
} }
void
AudioOutputControl::StopThread() noexcept
{
BeginDestroy();
if (thread.IsDefined())
thread.Join();
assert(IsCommandFinished());
}

View File

@ -566,6 +566,8 @@ private:
*/ */
void InternalDrain() noexcept; void InternalDrain() noexcept;
void StopThread() noexcept;
/** /**
* The OutputThread. * The OutputThread.
*/ */