socket: actually remove fd from poll when socket is closed

In my previous patch, I failed to call g_source_remove_unix_fd() in
order to actually stop polling the fd of the closed socket.

The test did not catch this, because the test only checks that the right
source callback is dispatched properly. I don't know how to test this.

https://bugzilla.gnome.org/show_bug.cgi?id=723655
This commit is contained in:
Michael Catanzaro 2017-10-24 19:52:17 -05:00
parent 9a319a126e
commit 4b07869462

View File

@ -3796,6 +3796,8 @@ socket_source_dispatch (GSource *source,
#else
if (g_socket_is_closed (socket_source->socket))
{
if (socket_source->fd_tag)
g_source_remove_unix_fd (source, socket_source->fd_tag);
socket_source->fd_tag = NULL;
events = G_IO_NVAL;
}