chiark / gitweb /
idtable better documented and sorted
[chiark-tcl.git] / dgram / dgram.c
index b2661a4fe82611792a359e02fb25a12ee3c713ff..08f5f45ace92aea45c11cca8ec7c9204c0a6cf7e 100644 (file)
@@ -154,13 +154,12 @@ int do_dgram_socket_on_receive(ClientData cd, Tcl_Interp *ip,
 
 int do_dgram_socket_close(ClientData cd, Tcl_Interp *ip, void *sock_v) {
   DgramSocket *sock= sock_v;
-  int sockix;
+
   cancel(sock);
   close(sock->fd); /* nothing useful to be done with errors */
-  sockix= sock->ix;
+  tabledataid_disposing(sock,&dgram_socks);
   TFREE(sock->addr_buf);
   TFREE(sock->msg_buf);
   TFREE(sock);
-  dgram_socks.a[sockix]= 0;
   return TCL_OK;
 }