From: Brian P. <br...@vm...> - 2009-09-08 15:18:08
|
Dimitar Kodjabachev wrote: > Hello, > > I sent this to mesa3d-dev, which was probably not the right place. mesa3d-dev is OK since there may be a bug in the Mesa wgl code. I'm cc'ing mesa3d-dev. > I have the following situation (pseudocode) with Mesa 7.4.4: > > hglrc1 = wglCreateContext(hdc1) > wglMakeCurrent(hdc1,hglrc1) > hglrc2 = wglCreateContext(hdc2) > wglMakeCurrent(hdc2,hglrc2) > wglMakeCurrent(hdc3,hglrc2) > wglDeleteContext(hglrc1) > wglDeleteContext(hglrc2) > > As a result of this sequence of calls, a WMesaFramebuffer structure is leaked. > The call causing the leak is wglMakeCurrent(hdc3,hglrc2). This is what I know > so far: > > -> wglMakeCurrent(hdc3,hglrc2) calls > -> WMesaMakeCurrent(hglrc2,hdc3) which calls > -> wmesa_lookup_framebuffer(hdc3) which returns NULL, as the hdc given to > wglMakeCurrent is different from the one given at the time > of wglCreateContext > -> wmesa_new_framebuffer() is called and a new frame buffer is allocated > > This new frame buffer is not released upon wglDeleteContext(hglrc2). A rendering context is not the same as a drawing surface. So deleting a rendering context does not imply deleting a surface. > As far as > I know, the device context passed to wglMakeCurrent does not have to > be the same as the one passed to wglCreateContext as long as the the actual > device and the pixel formats are. Is this correct or is my usage wrong? My understanding is that the context passed to wglMakeCurrent() must have been created by a call to wglCreateContext(). I don't think I can help with this memory leak. Maybe someone else who works on Windows can help you. -Brian |