gtkforphp / cairo

PHP extension for Cairo Graphics Library
Other
27 stars 19 forks source link

memory leak with v0.3.2 #13

Closed medic123de closed 9 years ago

medic123de commented 9 years ago

Hi, using php-fpm there seems to be a memory leak regarding FtFontFace

<?php $fontFile = "arial.ttf";

$surface = new \CairoImageSurface( CairoFormat::ARGB32, 750, 750 );

$context = new \CairoContext( $surface ); $fontFaceObject = new \CairoFtFontFace($fontFile);

// commenting next line will not leak $context->setFontFace( $fontFaceObject ); ?>

I found n-times the content of arial.ttf within allocated memory, where n equals number of requests.

therefore, the memory leak is directly related to sizeof($fontFaceObject) :-(

swen100 commented 9 years ago

i think that the memory-leaks (see also #2) were introduced with version 0.3.x and obviously seem to be caused by the (freetype-)font-handling.

I hope, that Elisabeth or one of the other developers with high c# skills have some time to take a deeper look at this problem.

auroraeosrose commented 9 years ago

this should be fixed now