Make copy of list before iterating over it.

master
Fedor 2020-01-21 14:00:44 +03:00
parent a82f9cb265
commit cbdf8d0622
1 changed files with 2 additions and 1 deletions

View File

@ -68,7 +68,8 @@ StreamControl::CloseAllReadStreams()
{ {
AssertOwningThread(); AssertOwningThread();
ReadStreamList::ForwardIterator iter(mReadStreamList); auto readStreamList = mReadStreamList;
ReadStreamList::ForwardIterator iter(readStreamList);
while (iter.HasMore()) { while (iter.HasMore()) {
iter.GetNext()->CloseStream(); iter.GetNext()->CloseStream();
} }