Merge branch 'fix/socket-use-after-close' into 'master'

gsocket: Fix use-after-close

See merge request GNOME/glib!1845
This commit is contained in:
Sebastian Dröge 2021-01-06 08:42:01 +00:00
commit b777b4caaa

View File

@ -3790,6 +3790,9 @@ update_select_events (GSocket *socket)
GList *l;
WSAEVENT event;
if (socket->priv->closed)
return;
ensure_event (socket);
event_mask = 0;
@ -3848,7 +3851,8 @@ update_condition_unlocked (GSocket *socket)
WSANETWORKEVENTS events;
GIOCondition condition;
if (WSAEnumNetworkEvents (socket->priv->fd,
if (!socket->priv->closed &&
WSAEnumNetworkEvents (socket->priv->fd,
socket->priv->event,
&events) == 0)
{