| Summary: | Memory leak on TextRenderer | ||
|---|---|---|---|
| Product: | [JogAmp] Jogl | Reporter: | Tof <cgarrigues> |
| Component: | opengl | Assignee: | Sven Gothel <sgothel> |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | gouessej |
| Priority: | --- | ||
| Version: | 2.4.0 | ||
| Hardware: | All | ||
| OS: | all | ||
| Type: | DEFECT | SCM Refs: |
1f0d7d4b416521ef56fdc81b28d128c7f3279188
|
| Workaround: | --- | ||
| Attachments: |
Proposed patch
Cleaned up Patch from original proposal |
||
|
Description
Tof
2014-11-03 17:55:24 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];
Created attachment 665 [details]
Proposed patch
Hi
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:
@Override
public void dispose(GLAutoDrawable drawable) {
mPipelinedQuadRenderer.dispose();
glu.destroy();
glu=null;
frame=null;
}
Please can you make a pull request?
Sorry, but I don't know how to do it ... :( (In reply to comment #4) > Sorry, but I don't know how to do it ... :( http://jogamp.org/wiki/index.php/How_to_Contribute Someone else has the same problem: http://forum.jogamp.org/TextRenderer-memory-leak-td4039967.html Maybe we should consider using the proposed patch. Move version to 2.4.0. Please test the proposed patch. We need a unit test? Created attachment 819 [details]
Cleaned up Patch from original proposal
(In reply to Tof from comment #2) > Created attachment 665 [details] > Proposed patch Excellent work Tof, thank you! I reviewed you code and indeed, the VBOs were not deleted. Your patch fixes this leak, IMHO. I added your patch and will push it soon commit 1f0d7d4b416521ef56fdc81b28d128c7f3279188 |