summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-17 22:53:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:58 -0500
commit196a5ec240c0386aff4f4442c9c44ac7cdd0a494 (patch)
tree03502ad2aea459c9a9e613bfee7ba275f791832b /source4
parentc06493912b9a8bb39a3d3459b9597daaa5d1c065 (diff)
downloadsamba-196a5ec240c0386aff4f4442c9c44ac7cdd0a494.tar.gz
samba-196a5ec240c0386aff4f4442c9c44ac7cdd0a494.tar.bz2
samba-196a5ec240c0386aff4f4442c9c44ac7cdd0a494.zip
r4811: now that the event context is at the socket level, the event cleanup
should be there too (This used to be commit 058ae5527e3daeb50eeea9e0ecee858c84e7e17d)
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/raw/clisocket.c13
-rw-r--r--source4/libcli/raw/clitransport.c1
2 files changed, 13 insertions, 1 deletions
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c
index 66555695d3..0edb95e1a1 100644
--- a/source4/libcli/raw/clisocket.c
+++ b/source4/libcli/raw/clisocket.c
@@ -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;
}
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c
index 55a7e25f72..eb9d2dde78 100644
--- a/source4/libcli/raw/clitransport.c
+++ b/source4/libcli/raw/clitransport.c
@@ -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;
}