Deleting a framebuffer makes my application to crash

Started by
4 comments, last by JGP 15 years, 4 months ago
When I try to delete a framebuffer because it is no longer used the application crashes. The FB is complete and has been used successfully. There are no OpenGL errors. It has one color attachment as RGBA. DEPTH-only attachments (as for shadow maps) don't crash It crashes saying: "unhandled exception in 0x0000000 viewer.exe: 0xC000005. How can I debug this error? Any ideas?
Advertisement
Are you saying it crashes in the driver? Does it say nvogl..dll or atiogl...dll?
Because if it does, it might be a driver bug.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Do you have a opengl context current when you call glDeleteFramebuffers? Are you deleting the framebuffer from a destructor?
It crashes inside the function glDeleteFramebuffersEXT but, according to the error message, it makes my EXE to crash, not any nvidia DLL.

HuntsMan: yes, I have the current opengl context active when I try to delete it. And yes I am deleting it from a destructor, but both the opengl context is OK and the framebuffer ID are valid at that point, so I don't see why that could crash my application.

PD: I found out that DEPTH-only framebuffers also makes it to crash.

Any ideas?
Upload some small code somewhere so that people can compile and test.
Have you tested on other machines?

Are you sure this isn't about glDeleteFramebuffersEXT being a NULL pointer?
Are you using glew?
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Oh my god! It was a NULL pointer issue! What a stupid mistake!

Thank you all for your help!

This topic is closed to new replies.

Advertisement