Hello all,

I'm having some trouble while compiling my project on Windows 7 using Qt 4.8 on Release mode. Everything works fine on Debug, but on Release I get an Unhandled Exception: 0xC0000005: Access violation.
I narrowed it down to the line where this happens, which is when I generate my Pixel Buffers.
My first guess would be wrong DLLs loading, but I checked the executable with Dependency Walker and every DLL loaded is correct.

Here goes some of my code:

Qt Code:
  1. class CameraView : public QGLWidget, protected QGLFunctions;
  2. void CameraView::initializeGL()
  3. {
  4.  
  5. initializeGLFunctions(this->context());
  6.  
  7. glGenBuffers(1, &pbo_); //<<<<< This is where I get the unhandled exception on Release mode
  8. glBindBuffer(QGLBuffer::PixelUnpackBuffer, pbo_);
  9. glBufferData(QGLBuffer::PixelUnpackBuffer, 3 * sizeof(BYTE) * image_width_ * image_height_, NULL, GL_STREAM_DRAW);
  10. ...
  11. }
To copy to clipboard, switch view to plain text mode 

Again, this works great on debug. Do you have any clue of why this is happening on Release only?

Thanks in advance,

Theo