mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-10-09 05:16:18 +00:00
Memory Leak in Sample35 (#3062)
* Memory Leak in Sample35 All but 6 chart samples can be rendered by Sample35. Of those 6, 3 of the problems are because the script runs out of memory processing them. Adopting a suggestion from @MAKS-dev in issue #2092, adding a call to gc_collect_cycles after the charts from each spreadsheet is rendered appears to make it possible to include those 3 spreadsheets in Sample35 after all. Also take advantage of this opportunity to correct a number (hopefully all) of Scrutinizer problems with JpgraphRendererBases. * Minor Fix Problem running 8.1 unit tests. * Resolve Problems with Pie 3D Charts Minor fix, leaving only one spreadsheet unusable in Sample35. The reasons for its unusability are now documented in the code. * Mitoteam Made Changes Discussing this problem with them, they decided they should make a change for Pie3D rather than forcing us to use the workaround pushed earlier. Change to require mitoteam 10.2.3, revert workaround.
This commit is contained in:
@@ -25,12 +25,10 @@ if (count($inputFileNames) === 1) {
|
||||
$unresolvedErrors = [];
|
||||
} else {
|
||||
$unresolvedErrors = [
|
||||
// The following spreadsheet was created by 3rd party software,
|
||||
// and doesn't include the data that usually accompanies a chart.
|
||||
// That is good enough for Excel, but not for JpGraph.
|
||||
'32readwriteBubbleChart2.xlsx',
|
||||
'32readwritePieChart3.xlsx',
|
||||
'32readwritePieChart4.xlsx',
|
||||
'32readwritePieChart3D1.xlsx',
|
||||
'32readwritePieChartExploded1.xlsx',
|
||||
'32readwritePieChartExploded3D1.xlsx',
|
||||
];
|
||||
}
|
||||
foreach ($inputFileNames as $inputFileName) {
|
||||
@@ -42,7 +40,9 @@ foreach ($inputFileNames as $inputFileName) {
|
||||
continue;
|
||||
}
|
||||
if (in_array($inputFileNameShort, $unresolvedErrors, true)) {
|
||||
$helper->log('File ' . $inputFileNameShort . ' does not yet work with this script');
|
||||
$helper->log('*****');
|
||||
$helper->log('***** File ' . $inputFileNameShort . ' does not yet work with this script');
|
||||
$helper->log('*****');
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -92,6 +92,7 @@ foreach ($inputFileNames as $inputFileName) {
|
||||
|
||||
$spreadsheet->disconnectWorksheets();
|
||||
unset($spreadsheet);
|
||||
gc_collect_cycles();
|
||||
}
|
||||
|
||||
$helper->log('Done rendering charts as images');
|
||||
|
||||
Reference in New Issue
Block a user