Skip to content

Commit

Permalink
fix: client no longer segfaults if client goes offline whilst there a…
Browse files Browse the repository at this point in the history
…re pending requests
  • Loading branch information
Jaskowicz1 committed Apr 5, 2024
1 parent 410378f commit c44af45
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rconpp/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ void rconpp::rcon_client::start(bool return_after) {
}

for (const queued_request& request : requests_queued) {
// If we're closing the connection down, we need to back out.
if(!connected)
return;

// Send data to callback if it's been set.
if (request.callback)
request.callback(send_data_sync(request.data, request.id, request.type));
Expand Down

0 comments on commit c44af45

Please sign in to comment.