robosport
03-29-2004, 06:33 PM
I recently ran my source through BoundsChecker to help identify any mem leaks.
It listed my OpenGL window's HDC as a resource leak. Specifically "Resource Leak Exiting Program" although I verified that ReleaseDC gets called on the way out.
I use the same code for creating and destroying windows and the only one that shows up as a leak is the OpenGL window that I create an RC for (in addition to the DC).
Here is what I am doing:
Create:
hwnd = CreateWindowEx( ... )
hdc = GetDC( hwnd )
wglChoosePixelFormatARB
SetPixelFormat
hrc = wglCreateContext
wglMakeCurrent( hdc, hrc )
Exit:
wglMakeCurrent( NULL, NULL )
wglDeleteContext( hrc )
ReleaseDC( hwnd, hdc )
Any clue what I'm missing with this issue?
Thank you.
It listed my OpenGL window's HDC as a resource leak. Specifically "Resource Leak Exiting Program" although I verified that ReleaseDC gets called on the way out.
I use the same code for creating and destroying windows and the only one that shows up as a leak is the OpenGL window that I create an RC for (in addition to the DC).
Here is what I am doing:
Create:
hwnd = CreateWindowEx( ... )
hdc = GetDC( hwnd )
wglChoosePixelFormatARB
SetPixelFormat
hrc = wglCreateContext
wglMakeCurrent( hdc, hrc )
Exit:
wglMakeCurrent( NULL, NULL )
wglDeleteContext( hrc )
ReleaseDC( hwnd, hdc )
Any clue what I'm missing with this issue?
Thank you.