Skip to content

Commit 58d20f8

Browse files
diylxywindowsair
authored andcommitted
fix(esp32): Fix double delete on uart bridge tcp netconn
1 parent 69c718e commit 58d20f8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

main/uart_bridge.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,10 @@ void uart_bridge_task() {
302302
} while (netbuf_next(netbuf) >= 0);
303303
netbuf_delete(netbuf);
304304
} else {
305-
if (events.nc->pending_err == ERR_CLSD) {
306-
continue; // The same hacky way to treat a closed connection
305+
if (is_conn_valid) {
306+
close_tcp_netconn(events.nc);
307+
uart_bridge_reset();
307308
}
308-
close_tcp_netconn(events.nc);
309-
uart_bridge_reset();
310309
}
311310
}
312311
}

0 commit comments

Comments
 (0)