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).
Hmmm, from what I can see here, everything looks good to me. The problem may not be your code. It could just be BoundsChecker. Programmer’s aren’t always perfect…
I don’t know if this is worth it but,
usually when creating a window and registering a class you would specify to create a private DC for the window(in the RegisterClass call: CS_OWNDC). Even though the WIN32 API docs explicitly says do not delete DC’s retrieved from GetDC this might be a special case. You can try changing ReleaseDC to DeleteDC and see if it makes BoundsChecker happy.