mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
shm: call close() after shutdown()
shutdown() doesn't close the file descriptor so we leak sockets if we don't call close(). https://bugzilla.gnome.org/show_bug.cgi?id=724077
This commit is contained in:
parent
f5a1ccd0de
commit
fd27bdf5f0
1 changed files with 5 additions and 1 deletions
|
@ -428,8 +428,10 @@ void
|
|||
sp_writer_close (ShmPipe * self, sp_buffer_free_callback callback,
|
||||
void *user_data)
|
||||
{
|
||||
if (self->main_socket >= 0)
|
||||
if (self->main_socket >= 0) {
|
||||
shutdown (self->main_socket, SHUT_RDWR);
|
||||
close (self->main_socket);
|
||||
}
|
||||
|
||||
if (self->socket_path) {
|
||||
unlink (self->socket_path);
|
||||
|
@ -841,6 +843,7 @@ sp_writer_accept_client (ShmPipe * self)
|
|||
|
||||
error:
|
||||
shutdown (fd, SHUT_RDWR);
|
||||
close (fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -893,6 +896,7 @@ sp_writer_close_client (ShmPipe * self, ShmClient * client,
|
|||
ShmClient *item = NULL, *prev_item = NULL;
|
||||
|
||||
shutdown (client->fd, SHUT_RDWR);
|
||||
close (client->fd);
|
||||
|
||||
again:
|
||||
for (buffer = self->buffers; buffer; buffer = buffer->next) {
|
||||
|
|
Loading…
Reference in a new issue