1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-03 04:23:50 +03:00

r4811: now that the event context is at the socket level, the event cleanup

should be there too
This commit is contained in:
Andrew Tridgell
2005-01-17 22:53:37 +00:00
committed by Gerald (Jerry) Carter
parent 7da0af98a0
commit 058ae5527e
2 changed files with 13 additions and 1 deletions

View File

@@ -35,6 +35,17 @@ struct clisocket_connect {
const char *dest_host;
};
static int smbcli_sock_destructor(void *ptr)
{
struct smbcli_socket *sock = talloc_get_type(ptr, struct smbcli_socket);
if (sock->event.fde && sock->event.ctx) {
event_remove_fd(sock->event.ctx, sock->event.fde);
}
return 0;
}
/*
create a smbcli_socket context
*/
@@ -53,6 +64,8 @@ struct smbcli_socket *smbcli_sock_init(TALLOC_CTX *mem_ctx)
return NULL;
}
talloc_set_destructor(sock, smbcli_sock_destructor);
return sock;
}

View File

@@ -54,7 +54,6 @@ static int transport_destructor(void *ptr)
struct smbcli_transport *transport = ptr;
smbcli_transport_dead(transport);
event_remove_fd(transport->socket->event.ctx, transport->socket->event.fde);
event_remove_timed(transport->socket->event.ctx, transport->socket->event.te);
return 0;
}