mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 03:31:45 +08:00
修复rtsp组播遍历迭代器导致崩溃的bug
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user