Explorar o código

fix worker->connection

walkor %!s(int64=10) %!d(string=hai) anos
pai
achega
4cf55fc3db
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      Workerman/Connection/TcpConnection.php

+ 4 - 1
Workerman/Connection/TcpConnection.php

@@ -559,7 +559,10 @@ class TcpConnection extends ConnectionInterface
                echo $e;
            }
        }
-       unset($this->worker->connections[(int)$this->_socket]);
+       if($this->worker)
+       {
+           unset($this->worker->connections[(int)$this->_socket]);
+       }
        Worker::$globalEvent->del($this->_socket, EventInterface::EV_READ);
        Worker::$globalEvent->del($this->_socket, EventInterface::EV_WRITE);
        @fclose($this->_socket);