windows: fix visual object memleak
authorThomas Henn <thomas.henn@igd.fraunhofer.de>
Wed, 26 Nov 2008 16:51:29 +0000 (09:51 -0700)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 26 Nov 2008 16:51:29 +0000 (09:51 -0700)
src/mesa/drivers/windows/gdi/wmesa.c

index 42432d6064f466ccd9112d173e15eab2eeff12f9..80746950c714aa898dfecbdc2f8819e2d3a4a880 100644 (file)
@@ -1505,6 +1505,9 @@ WMesaContext WMesaCreateContext(HDC hDC,
     ctx = &c->gl_ctx;
     _mesa_initialize_context(ctx, visual, NULL, &functions, (void *)c);
 
+    /* visual no longer needed - it was copied by _mesa_initialize_context() */
+    _mesa_destroy_visual(visual);
+
     _mesa_enable_sw_extensions(ctx);
     _mesa_enable_1_3_extensions(ctx);
     _mesa_enable_1_4_extensions(ctx);