PHPExcel 内存泄漏

解决办法 在 PHPExcel_Worksheet 类中增加方法:

代码如下 复制代码

public function Destroy() {
   foreach($this->_cellCollection as $index => $dummy) {
      $this->_cellCollection[$index] = null;
  }

}

并在 PHPExcel 类中增加方法:

public function destroy() {
   foreach($this->_workSheetCollection as $index => $dummy) {
      $this->_workSheetCollection[$index]->Destroy();
      $this->_workSheetCollection[$index] = null;
   }
}

$phpExcel->destroy();

记录一下

评论

暂无评论