To put the final nail in the coffin, even this minimal code sample will cause memory usage to constantly rise:
#include <windows.h>
#include <GL/gl.h>
int main() {
auto window = CreateWindowA( "STATIC", "", WS_POPUP | WS_DISABLED, 0, 0, 1, 1, NULL, NULL, GetModuleHandle( NULL ), NULL );
ShowWindow( window, SW_HIDE );
auto deviceContext = GetDC( window );
PIXELFORMATDESCRIPTOR descriptor;
ZeroMemory( &descriptor, sizeof( descriptor ) );
descriptor.nSize = sizeof( descriptor );
descriptor.nVersion = 1;
descriptor.iLayerType = PFD_MAIN_PLANE;
descriptor.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
descriptor.iPixelType = PFD_TYPE_RGBA;
descriptor.cColorBits = 32;
descriptor.cDepthBits = 24;
descriptor.cStencilBits = 8;
descriptor.cAlphaBits = 0;
auto format = ChoosePixelFormat( deviceContext, &descriptor );
SetPixelFormat( deviceContext, format, &descriptor );
while( true ) {
auto context = wglCreateContext( deviceContext );
wglDeleteContext( context );
}
ReleaseDC( window, deviceContext );
DestroyWindow( window );
}
Since the loop only makes calls to wgl, it is wgl or the driver that is causing the leak for sure.