[Mesa-users] opengl32.dll crash in releasing DeviceContext/RenderContext

Michael Keutel mail at michaelkeutel.de
Mon May 6 02:32:03 PDT 2013


Hey, I am using Mesa 3D 7.8.2 on Windows7 in an C++ realtime application 
(Visual Studio 2008). I have a screenshot-functionality in my 
application which renders into a hidden window and saves to image. For 
doing this I have to change the device context from main render context 
to the hidden-window-context and back again after screenshot is saved to 
disk. It works well except for the release of the temporary device context:

     wglMakeCurrent(NULL, NULL);
     wglMakeCurrent(this->hDeviceContext, this->hOGLRenderContext);      
// switch back to main context
     wglDeleteContext(rc);        // release temporary render context - 
causing crash
     ReleaseDC(NULL, dc);         // release temporary device context - 
causing crash

My application crashes with an error saying that "the value of ESP has 
not been set ..." . BUT it does not crash directly when proceeding 
wglDeleteContext or ReleaseDC but immedietly when the main context is 
used again and the first opengl command is done on that context. If I 
ommit the last 2 lines here and dont release the temporary contexts 
everything works fine. Should I just NOT release the temporary contexts? 
I found some other mail entries where changing of device contexts might 
have caused memory leaks. Is it a similar problem here?

Thx
Michael

-- 
Beste Grüße,
Michael Keutel

Dipl.-Ing. der Computervisualistik

Arndtstraße 35
04275 Leipzig
0151 54603689
mail: mail at michaelkeutel.de
web:  www.michaelkeutel.de





More information about the mesa-users mailing list