From: Gilles Depeyrot Date: Fri, 5 Oct 2001 19:01:13 +0000 (+0000) Subject: correction for memory leak X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/bf44306ebca5d26e204ef17851516d844bc2f0a7 correction for memory leak git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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)