Commit 7732db0a authored by Max Kellermann's avatar Max Kellermann

output/Control: move code to method StopThread()

parent 37f984ba
...@@ -38,10 +38,7 @@ AudioOutputControl::AudioOutputControl(std::unique_ptr<FilteredAudioOutput> _out ...@@ -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 ...@@ -383,3 +380,14 @@ AudioOutputControl::BeginDestroy() noexcept
} }
} }
} }
void
AudioOutputControl::StopThread() noexcept
{
BeginDestroy();
if (thread.IsDefined())
thread.Join();
assert(IsCommandFinished());
}
...@@ -566,6 +566,8 @@ private: ...@@ -566,6 +566,8 @@ private:
*/ */
void InternalDrain() noexcept; void InternalDrain() noexcept;
void StopThread() noexcept;
/** /**
* The OutputThread. * The OutputThread.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment