소스 검색

Allow delete this in onclose callback for #496

ithewei 1 년 전
부모
커밋
90e3b2fa13
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      evpp/TcpClient.h

+ 2 - 2
evpp/TcpClient.h

@@ -154,11 +154,11 @@ public:
             }
         };
         channel->onclose = [this]() {
+            bool reconnect = reconn_setting != NULL;
             if (onConnection) {
                 onConnection(channel);
             }
-            // reconnect
-            if (reconn_setting) {
+            if (reconnect) {
                 startReconnect();
             }
         };