mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
修复rtsp组播遍历迭代器导致崩溃的bug
This commit is contained in:
parent
f3f4b49332
commit
cb4ab21548
@ -82,10 +82,12 @@ void UDPServer::onRecv(int interleaved, const Buffer::Ptr &buf, struct sockaddr*
|
||||
return;
|
||||
}
|
||||
auto &ref = it0->second;
|
||||
for (auto it1 = ref.begin(); it1 != ref.end(); ++it1) {
|
||||
for (auto it1 = ref.begin(); it1 != ref.end();) {
|
||||
auto &func = it1->second;
|
||||
if (!func(interleaved, buf, peer_addr)) {
|
||||
it1 = ref.erase(it1);
|
||||
} else {
|
||||
++it1;
|
||||
}
|
||||
}
|
||||
if (ref.size() == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user