Parcourir la source

fix worker->connection

walkor il y a 10 ans
Parent
commit
4cf55fc3db
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  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);