{"action":"created","issue":{"url":"https://api.github.com/repos/gtkforphp/cairo/issues/2","labels_url":"https://api.github.com/repos/gtkforphp/cairo/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/gtkforphp/cairo/issues/2/comments","events_url":"https://api.github.com/repos/gtkforphp/cairo/issues/2/events","html_url":"https://github.com/gtkforphp/cairo/issues/2","id":17855337,"number":2,"title":"memory leak / segmentation fault after ft_mem_free() when using freetype .","user":{"login":"swen100","id":1837968,"avatar_url":"https://avatars.githubusercontent.com/u/1837968?v=3","gravatar_id":"","url":"https://api.github.com/users/swen100","html_url":"https://github.com/swen100","followers_url":"https://api.github.com/users/swen100/followers","following_url":"https://api.github.com/users/swen100/following{/other_user}","gists_url":"https://api.github.com/users/swen100/gists{/gist_id}","starred_url":"https://api.github.com/users/swen100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swen100/subscriptions","organizations_url":"https://api.github.com/users/swen100/orgs","repos_url":"https://api.github.com/users/swen100/repos","events_url":"https://api.github.com/users/swen100/events{/privacy}","received_events_url":"https://api.github.com/users/swen100/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":22,"created_at":"2013-08-09T10:02:04Z","updated_at":"2015-02-06T16:11:24Z","closed_at":null,"body":"This error still exists, so i thought i give more detailed informations.\r\n\r\nI am able to reproduce a memory leak with the following script:\r\n```php\r\n<?php\r\n$fontFile = dirname(__FILE__) . \"/Vera.ttf\";\r\n\r\n$surface = new \\CairoImageSurface(\r\n    CairoFormat::ARGB32,\r\n    750,\r\n    750\r\n);\r\n$context = new \\CairoContext( $surface );\r\n\r\ntry {\r\n    $fontFaceObject = new \\CairoFtFontFace($fontFile);\r\n    //$fontFaceObject = cairo_ft_font_face_create($fontFile);\r\n    $context->setFontFace( $fontFaceObject );\r\n    $CairoFontMatrix = new \\CairoMatrix();\r\n\r\n    $CairoFontMatrix->scale( 12, 12 );\r\n\r\n    for( $i = 0; $i < 10; ++$i ) {\r\n        $angle = rand(1, 360);\r\n        $CairoFontMatrix->rotate(deg2rad($angle));\r\n        $context->setFontMatrix( $CairoFontMatrix );\r\n\r\n        $x = rand(0, 750);\r\n        $y = rand(0, 750);\r\n        $context->MoveTo( $x, $y );\r\n        $context->textPath( \"blah\" );\r\n\r\n        $context->setSourceRgba(\r\n            rand(0,255) / 255, rand(0,255) / 255, rand(0,255) / 255, 1 - rand(0,255) / 255\r\n        );\r\n        $context->fill();\r\n    }\r\n\r\n} catch (\\CairoException $exc) {\r\n    echo \"<pre>\";\r\n    print_r($exc);\r\n    print_r($fontFaceObject);\r\n    echo $exc->getMessage();\r\n    echo $exc->getTraceAsString();\r\n    die();\r\n}\r\n\r\nheader( \"Content-Type: image/png\" );\r\n$surface->writeToPng( \"php://output\" );\r\n\r\nunset($context);\r\nunset($surface);\r\nunset($fontFaceObject);\r\n```"},"comment":{"url":"https://api.github.com/repos/gtkforphp/cairo/issues/comments/73261318","html_url":"https://github.com/gtkforphp/cairo/issues/2#issuecomment-73261318","issue_url":"https://api.github.com/repos/gtkforphp/cairo/issues/2","id":73261318,"user":{"login":"auroraeosrose","id":282573,"avatar_url":"https://avatars.githubusercontent.com/u/282573?v=3","gravatar_id":"","url":"https://api.github.com/users/auroraeosrose","html_url":"https://github.com/auroraeosrose","followers_url":"https://api.github.com/users/auroraeosrose/followers","following_url":"https://api.github.com/users/auroraeosrose/following{/other_user}","gists_url":"https://api.github.com/users/auroraeosrose/gists{/gist_id}","starred_url":"https://api.github.com/users/auroraeosrose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auroraeosrose/subscriptions","organizations_url":"https://api.github.com/users/auroraeosrose/orgs","repos_url":"https://api.github.com/users/auroraeosrose/repos","events_url":"https://api.github.com/users/auroraeosrose/events{/privacy}","received_events_url":"https://api.github.com/users/auroraeosrose/received_events","type":"User","site_admin":false},"created_at":"2015-02-06T16:11:24Z","updated_at":"2015-02-06T16:11:24Z","body":"possibly - freetype is a horribly buggy library :(  we can remove that, ti's there to clear out memory properly for use with valgrind, but if it's bombing we can just take it out "}}