ソースを参照

fix worker->connection

walkor 10 年 前
コミット
4cf55fc3db
1 ファイル変更4 行追加1 行削除
  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);