mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-28 19:20:54 +00:00
remove connection from connection list on close - thanks to frankb for spotting this bug
This commit is contained in:
parent
9418f9c94c
commit
f025210d67
@ -546,8 +546,7 @@ connection_t * socket_connection_open_tcp(const char *address, uint16_t port){
|
||||
int socket_connection_close_tcp(connection_t * connection){
|
||||
if (!connection) return -1;
|
||||
shutdown(connection->ds.fd, SHUT_RDWR);
|
||||
run_loop_remove_data_source(&connection->ds);
|
||||
free( connection );
|
||||
socket_connection_free_connection(connection);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -580,8 +579,7 @@ connection_t * socket_connection_open_unix(){
|
||||
int socket_connection_close_unix(connection_t * connection){
|
||||
if (!connection) return -1;
|
||||
shutdown(connection->ds.fd, SHUT_RDWR);
|
||||
run_loop_remove_data_source(&connection->ds);
|
||||
free( connection );
|
||||
socket_connection_free_connection(connection);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user