so there is a memory leak in org.newdawn.slick.opengl.renderer.ImmediateModeOGLRenderer
specifically in glColor4f(float r, float g, float b, float a)
I use g.setColor A LOT, which eventually calls this method
This floods my memory ~ around 1.8MB per second
the Class has a variable for the current Color, which is good: private float[] current = new float[] {1,1,1,1};
However, whenever you call glColor4f(float r, float g, float b, float a), it looks like this
Code:
public void glColor4f(float r, float g, float b, float a) {
a *= alphaScale;
//current = new float[] {r,g,b,a};
GL11.glColor4f(r, g, b, a);
}
So yeah the
new keyword causes the leak.
Fix:Code:
public void glColor4f(float r, float g, float b, float a) {
a *= alphaScale;
current[0] = r;
current[1] = g;
current[2] = b;
current[3] = a;
GL11.glColor4f(r, g, b, a);
}
how much difference ? much. now my memory doesn't even raise at all when nothing is happening.
Please, who ever has access to SVN, fix this. Having "my own" Slick version isn't cool at all when Slick gets other improvements and I have to manually add them.