I have an annoying开发者_高级运维 and unfortunately urgent problem. I started out by trying to subclass the QGLWidget for my Windows application in Visual Studio 2008 x86. It crashed immediately upon running, as far as I could tell, when the QGLWidget was instantiated. Finally I ended up trying all the included Qt examples for Open GL, and they all behave the same - crashing as follows:
Error message pops up:
"Windows has triggered a breakpoint in 2dpainting.exe..."
The execution halts in qgl_win.cpp (breakpoint indicated):
QGLTemporaryContext::~QGLTemporaryContext()
{
wglMakeCurrent(d->dmy_pdc, 0);
wglDeleteContext(d->dmy_rc);
ReleaseDC(d->dmy_id, d->dmy_pdc);
DestroyWindow(d->dmy_id);
--> if (d->old_dc && d->old_context)
wglMakeCurrent(d->old_dc, d->old_context);
}
Output:
... HEAP[2dpainting.exe]: HEAP: Free Heap block a40c108 modified at a40c288 after it was freed Windows has triggered a breakpoint in 2dpainting.exe.
This may be due to a corruption of the heap, which indicates a bug in 2dpainting.exe or any of the DLLs it has loaded ...
Also happens when I switch from debug to release. However, I can run most of these Open GL example compiled executables just fine. I can't find anything through internet searches. Gurus, please help!
Thanks, Matt
I resolved the problem by updating my graphics drivers to their latest version. Strange, because I'm using the Intel GMA 965 Express chipset, which is already very old. Now all the Qt examples compile just fine. No heap corruption.
I'm also able to run the main Qt Examples and Demos app from the start menu, which I was never able to do before - it would just crash.
精彩评论