Bug 1101 - Memory leak on TextRenderer
Summary: Memory leak on TextRenderer
Alias: None
Product: Jogl
Classification: JogAmp
Component: opengl (show other bugs)
Version: 2
Hardware: All all
: --- major
Assignee: Sven Gothel
Depends on:
Reported: 2014-11-03 17:55 CET by Tof
Modified: 2015-04-01 13:05 CEST (History)
1 user (show)

See Also:
Type: ---
SCM Refs:
Workaround: ---

Proposed patch (79.25 KB, patch)
2014-11-04 13:25 CET, Tof
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tof 2014-11-03 17:55:24 CET
When using VBO, they are non released on dispose()
 in class Pipelined_QuadRenderer.
Lead to system memory leak when creating and deleting com.jogamp.opengl.util.awt.TexRenderer objects.
Comment 1 Tof 2014-11-04 13:22:18 CET
class Pipelined_QuadRenderer in TextRenderer.java,line 1786 :

                    gl.glGenBuffers(2, IntBuffer.wrap(vbos));

                    mVBO_For_ResuableTileVertices = vbos[0];
                    mVBO_For_ResuableTileTexCoords = vbos[1];
Comment 2 Tof 2014-11-04 13:25:35 CET
Created attachment 665 [details]
Proposed patch
Comment 3 Julien Gouesse 2015-03-31 16:41:01 CEST

You added a dispose() method into the main class:
public void dispose() {
             GL2 gl = GLContext.getCurrentGL().getGL2();
             int[] vbos = new int[2];
             vbos[0] = mVBO_For_ResuableTileVertices;
             vbos[1] = mVBO_For_ResuableTileTexCoords;
             gl.glDeleteBuffers(2, IntBuffer.wrap(vbos));

and you improved the dispose() method of the debug listener:
        public void dispose(GLAutoDrawable drawable) {

Please can you make a pull request?
Comment 4 Tof 2015-04-01 09:46:20 CEST
Sorry, but I don't know how to do it ... :(
Comment 5 Julien Gouesse 2015-04-01 13:05:03 CEST
(In reply to comment #4)
> Sorry, but I don't know how to do it ... :(