Login  Register

TextRenderer resource leak

Posted by slajar on Dec 20, 2014; 10:16pm
URL: https://forum.jogamp.org/TextRenderer-resource-leak-tp4033797.html

Merry christmas to all of you.

Well, I currently on the hunt after ogl resource leaks in my application. OpenGL profiler don't show anything *puh*
But -Djogl.debug.GLBufferObjectTracker=true shows a potential leak.

My application has a user selectable text feature. That means the user can select font, size, color and position of the 2D Text. Every time the user selects a new font or size the textrenderer is beeing destroyed and allocated with the new data.

That's why it is always calling

 if (mPipelinedQuadRenderer == null) {
                    mPipelinedQuadRenderer = new Pipelined_QuadRenderer();
                }

in TextRenderer line 1473.

This causes a call to:
final int[] vbos = new int[2];
gl.glGenBuffers(2, IntBuffer.wrap(vbos));

line 1781:TextRenderer

Those two allocated Buffers are never ever released by glDeleteBuffers. I read here (http://www.java-gaming.org/topics/memory-leak-in-textrenderer/18325/view.html) that it is common practice to have one allocated TextRenderer and reuse it. Actually, I cannot reuse the textrenderer since there is no mothod setFont in TextRenderer.

Is there another possibility to achive this feature or is this just a bug?


TIA
Matthias