diff --git a/src/mac/carbon/glcanvas.cpp b/src/mac/carbon/glcanvas.cpp index 6c1459db38..0b86e94269 100644 --- a/src/mac/carbon/glcanvas.cpp +++ b/src/mac/carbon/glcanvas.cpp @@ -301,7 +301,11 @@ IMPLEMENT_CLASS(wxGLApp, wxApp) bool wxGLApp::InitGLVisual(int *attribList) { AGLPixelFormat fmt = ChoosePixelFormat(attribList); - return (fmt != NULL); + if (fmt != NULL) { + aglDestroyPixelFormat(fmt); + return true; + } else + return false; } wxGLApp::~wxGLApp(void) diff --git a/src/mac/glcanvas.cpp b/src/mac/glcanvas.cpp index 6c1459db38..0b86e94269 100644 --- a/src/mac/glcanvas.cpp +++ b/src/mac/glcanvas.cpp @@ -301,7 +301,11 @@ IMPLEMENT_CLASS(wxGLApp, wxApp) bool wxGLApp::InitGLVisual(int *attribList) { AGLPixelFormat fmt = ChoosePixelFormat(attribList); - return (fmt != NULL); + if (fmt != NULL) { + aglDestroyPixelFormat(fmt); + return true; + } else + return false; } wxGLApp::~wxGLApp(void)