Improve memory usage of color.module (de-allocate images earlier)
parent
1c7f089dea
commit
fcf4c6a7e8
|
@ -359,6 +359,9 @@ function _color_render_images($theme, &$info, &$paths, $palette) {
|
||||||
// Blend over template
|
// Blend over template
|
||||||
imagecopy($target, $source, 0, 0, 0, 0, $width, $height);
|
imagecopy($target, $source, 0, 0, 0, 0, $width, $height);
|
||||||
|
|
||||||
|
// Clean up template image
|
||||||
|
imagedestroy($source);
|
||||||
|
|
||||||
// Cut out slices
|
// Cut out slices
|
||||||
foreach ($info['slices'] as $file => $coord) {
|
foreach ($info['slices'] as $file => $coord) {
|
||||||
list($x, $y, $width, $height) = $coord;
|
list($x, $y, $width, $height) = $coord;
|
||||||
|
@ -385,8 +388,7 @@ function _color_render_images($theme, &$info, &$paths, $palette) {
|
||||||
$paths['map'][$file] = $base;
|
$paths['map'][$file] = $base;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up
|
// Clean up target buffer
|
||||||
imagedestroy($source);
|
|
||||||
imagedestroy($target);
|
imagedestroy($target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue