Skip to content

Commit 6afb12c

Browse files
committed
Prevent poll for closed socket
1 parent 65947fd commit 6afb12c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,10 @@ void ThreadedSocketConnection::Transmit() {
257257
poll_fds[1].events = POLLIN | POLLPRI;
258258

259259
SDL_LOG_TRACE("poll " << this);
260+
if (-1 == socket_) {
261+
SDL_LOG_TRACE("Socket is closed.");
262+
return;
263+
}
260264
if (-1 == poll(poll_fds, kPollFdsSize, -1)) {
261265
SDL_LOG_ERROR_WITH_ERRNO("poll failed for connection " << this);
262266
Abort();

0 commit comments

Comments
 (0)