-
Notifications
You must be signed in to change notification settings - Fork 229
Description
I am using C API binding for text rendering in Qt. I need to continuously render with different/same text.
Current implementation: On every frame update I call PFSceneProxyBuildAndRenderGL with same PFGLRendererRef and PFBuildOptionsRef.
After every render I call PFSceneProxyDestroy assuming that it destroys scene_proxy(PFSceneProxyRef), scene(PFSceneRef) and canvas(PFCanvasRef).
I initialize scene, proxy, canvas again. It looked expensive in terms of processing and memory to use new renderer on every update.
My Issue: I see memory leak somewhere, memory is constantly growing until application becomes unresponsive.
Am I missing something obvious?
Here is sample:
In my render():
PFSceneProxyBuildAndRenderGL(scene_proxy, renderer, option);
All of the parameters are global here. Before next render I do this:
PFSceneProxyDestroy(scene_proxy);
PFCanvasSetFontByPostScriptName(textCanvas, "Dosis-ExtraBold", 15);
PFCanvasSetFontSize(textCanvas, 32.0);
style = PFFillStyleCreateColor(&color);
PFCanvasSetFillStyle(textCanvas, style);
PFCanvasFillText(textCanvas, str, str.length(), &pos);
scene = PFCanvasCreateScene(textCanvas);
scene_proxy = PFSceneProxyCreateFromSceneAndRayonExecutor(scene);
render();