X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_state.c;h=93a3f1bbc175ccbe05ec6dd9482dae56cbd654bc;hb=ce2e5aba172eb85cda2b4f047bdcf9f54d019fd7;hp=ff375b9e00411dd4b850f15b9a0a7b3f3514d875;hpb=e9a96a71a2feff9da7ccae395c5f316e67af3bd0;p=freeglut diff --git a/src/freeglut_state.c b/src/freeglut_state.c index ff375b9..93a3f1b 100644 --- a/src/freeglut_state.c +++ b/src/freeglut_state.c @@ -260,7 +260,15 @@ int FGAPIENTRY glutGet( GLenum eWhat ) /* I do not know yet if there will be a fgChooseVisual() function for Win32 */ case GLUT_DISPLAY_MODE_POSSIBLE: - return( fgChooseVisual() == NULL ? 0 : 1 ); + { + XVisualInfo* visualInfo = fgChooseVisual(); + if ( visualInfo == NULL ) { + return 0; + } else { + XFree( visualInfo ); + return 1; + } + } /* This is system-dependant */ case GLUT_WINDOW_FORMAT_ID: