1
This commit is contained in:
parent
6cd0a7d958
commit
497ca5808e
@ -138,11 +138,18 @@ void GGListener::Init()
|
|||||||
int gg_socket = args.Get<int>(0);
|
int gg_socket = args.Get<int>(0);
|
||||||
auto itr = disconnect_listener_hash_.find(gg_socket);
|
auto itr = disconnect_listener_hash_.find(gg_socket);
|
||||||
if (itr != disconnect_listener_hash_.end()) {
|
if (itr != disconnect_listener_hash_.end()) {
|
||||||
class SocketDisconnectHandler *handle = nullptr, *tmp = nullptr;
|
std::vector<std::weak_ptr<SocketDisconnectHandler>> del_handlers;
|
||||||
|
{
|
||||||
|
SocketDisconnectHandler *handle = nullptr, *tmp = nullptr;
|
||||||
list_for_each_entry_safe(handle, tmp, &itr->second, entry) {
|
list_for_each_entry_safe(handle, tmp, &itr->second, entry) {
|
||||||
|
del_handlers.push_back(handle->holder);
|
||||||
handle->cb(a8::Args({}));
|
handle->cb(a8::Args({}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (auto handler : del_handlers) {
|
||||||
|
RemoveSocketDisconnectHandler(handler);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user