dwmkerr / sharpgl

Use OpenGL in .NET applications. SharpGL wraps all modern OpenGL features and offers a powerful scene graph to aid development.
MIT License
755 stars 299 forks source link

Buffer memory not released #94

Open GEMISIS opened 9 years ago

GEMISIS commented 9 years ago

The IndexBuffer, VertexBuffer, and VertexBufferArray classes do not seem to be releasing their memory that is allocated with the GenBuffers method, resulting in large memory consumption and applications crashing after a certain amount of time..

dwmkerr commented 9 years ago

Hi @gemisis I'm looking into this one shortly, I would expect the fix in the new few days, thanks for the heads up :+1:

philstopford commented 9 years ago

Is there any news on this?

JPTIZ commented 8 years ago

_Bump_

Got the exactly same issue. I think I inserted the leak while changing my code, so it might be how you make these operations, but no confirmation.

GianlucaGrotto commented 2 years ago

Got the exactly same issue with 3.1.1 version. If I pass geometry dinamically the memory continue to increase very fast. You can reproduce the issue using ModernOpenGLSample and recalling the method scene.CreateVerticesForSquare() before Draw().

maybe buffers should be deleted, in this case VertexBuffer should include a method like this:

public void Delete(OpenGL gl) { gl.DeleteBuffers(1, new uint[1] { vertexBufferObject }); }