Ver Fonte

Allow delete this in onclose callback for #496

ithewei há 1 ano atrás
pai
commit
90e3b2fa13
1 ficheiros alterados com 2 adições e 2 exclusões
  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();
             }
         };