* When deleting a socket, we also need to delete all of its children.
* This fixes a KDL I often seen when launching firefox. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24046 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
0dd3108ca0
commit
0db772c937
@ -65,6 +65,21 @@ compute_user_iovec_length(iovec *userVec, uint32 count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
delete_children(struct list *list)
|
||||||
|
{
|
||||||
|
while (true) {
|
||||||
|
net_socket_private *child
|
||||||
|
= (net_socket_private *)list_remove_head_item(list);
|
||||||
|
if (child == NULL)
|
||||||
|
break;
|
||||||
|
|
||||||
|
child->parent = NULL;
|
||||||
|
socket_delete(child);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
create_socket(int family, int type, int protocol, net_socket_private **_socket)
|
create_socket(int family, int type, int protocol, net_socket_private **_socket)
|
||||||
{
|
{
|
||||||
@ -364,6 +379,10 @@ socket_delete(net_socket *_socket)
|
|||||||
list_remove_item(&sSocketList, socket);
|
list_remove_item(&sSocketList, socket);
|
||||||
benaphore_unlock(&sSocketLock);
|
benaphore_unlock(&sSocketLock);
|
||||||
|
|
||||||
|
// also delete all children of this socket
|
||||||
|
delete_children(&socket->pending_children);
|
||||||
|
delete_children(&socket->connected_children);
|
||||||
|
|
||||||
put_domain_protocols(socket);
|
put_domain_protocols(socket);
|
||||||
benaphore_destroy(&socket->lock);
|
benaphore_destroy(&socket->lock);
|
||||||
delete_select_sync_pool(socket->select_pool);
|
delete_select_sync_pool(socket->select_pool);
|
||||||
|
Loading…
Reference in New Issue
Block a user