mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-08 20:27:38 +02:00
better server shutdown
This commit is contained in:
parent
679fbaaca0
commit
2275466d09
2 changed files with 7 additions and 8 deletions
|
@ -389,6 +389,13 @@ void StreamServer::start()
|
|||
|
||||
void StreamServer::stop()
|
||||
{
|
||||
// std::lock_guard<std::mutex> mlock(sessionsMutex_);
|
||||
for (auto session: sessions_)//it = sessions_.begin(); it != sessions_.end(); ++it)
|
||||
{
|
||||
if (session)
|
||||
session->stop();
|
||||
}
|
||||
|
||||
if (controlServer_)
|
||||
{
|
||||
controlServer_->stop();
|
||||
|
@ -406,12 +413,5 @@ void StreamServer::stop()
|
|||
streamManager_->stop();
|
||||
streamManager_ = nullptr;
|
||||
}
|
||||
// std::lock_guard<std::mutex> mlock(sessionsMutex_);
|
||||
for (auto session: sessions_)//it = sessions_.begin(); it != sessions_.end(); ++it)
|
||||
{
|
||||
if (session)
|
||||
session->stop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue