xdemos/glxcontexts: Don't leak visual info when choosing visual again.
authorPauli Nieminen <suokkos@gmail.com>
Mon, 3 Aug 2009 17:43:38 +0000 (10:43 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 3 Aug 2009 17:55:29 +0000 (11:55 -0600)
Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
progs/xdemos/glxcontexts.c

index 481749be3d83871c301a47286e6ed10d32beaca8..9f83679acd3e3b9ad97c76e3d9a56bb53bc44f73 100644 (file)
@@ -378,6 +378,9 @@ make_window( Display *dpy, const char *name,
    scrnum = DefaultScreen( dpy );
    root = RootWindow( dpy, scrnum );
 
+   if (visinfo)
+          XFree(visinfo);
+
    visinfo = glXChooseVisual( dpy, scrnum, attribs );
    if (!visinfo) {
       printf("Error: couldn't get an RGB, Double-buffered visual\n");