Skip to content

Commit

Permalink
Allow delete this in onclose callback for #496
Browse files Browse the repository at this point in the history
  • Loading branch information
ithewei committed Mar 7, 2024
1 parent 67139ab commit 90e3b2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions evpp/TcpClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ class TcpClientEventLoopTmpl {
}
};
channel->onclose = [this]() {
bool reconnect = reconn_setting != NULL;
if (onConnection) {
onConnection(channel);
}
// reconnect
if (reconn_setting) {
if (reconnect) {
startReconnect();
}
};
Expand Down

0 comments on commit 90e3b2f

Please sign in to comment.