PHPOffice / PHPExcel

ARCHIVED
Other
11.46k stars 4.19k forks source link

Memory leak when removing sheet by index #1046

Open psam44 opened 8 years ago

psam44 commented 8 years ago

In PHPExcel.php removeSheetByIndex(), change:

        } else {
            array_splice($this->workSheetCollection, $pIndex, 1);

by:

        } else {
            $this->workSheetCollection[$pIndex]->disconnectCells();
            $this->workSheetCollection[$pIndex] = null;
            array_splice($this->workSheetCollection, $pIndex, 1);

Note: this is an old issue. I detected it in a legacy application using version 1.7.6.

Quix0r commented 8 years ago

1.8.1 is out. Is this still the case with the newer version? And please don't report bugs for old versions (I won't accept it).

psam44 commented 8 years ago

Confusion, by 'old' I meant this issue is there at least since 1.7.6, and still there in 1.8.1 (as my two other issues submitted the same day as this one).

Quix0r commented 8 years ago

Okay, was a bit confusing. :-)