Skip to content

Memory leak in C API Binding #286

@VijithK

Description

@VijithK

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();

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions