Fix crash during shutdown

In case there are multiple PosixStreams with the same name, the server crashed during shutdown
This commit is contained in:
badaix 2020-01-06 18:50:57 +01:00
parent e12fa3fc7d
commit 062e46060c
4 changed files with 9 additions and 7 deletions

View file

@ -143,15 +143,16 @@ const PcmStreamPtr StreamManager::getStream(const std::string& id)
void StreamManager::start()
{
for (auto stream : streams_)
for (const auto& stream : streams_)
stream->start();
}
void StreamManager::stop()
{
for (auto stream : streams_)
stream->stop();
for (const auto& stream : streams_)
if (stream)
stream->stop();
}