]> git.saurik.com Git - wxWidgets.git/commitdiff
correction for memory leak
authorGilles Depeyrot <gilles_depeyrot@mac.com>
Fri, 5 Oct 2001 19:01:13 +0000 (19:01 +0000)
committerGilles Depeyrot <gilles_depeyrot@mac.com>
Fri, 5 Oct 2001 19:01:13 +0000 (19:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/glcanvas.cpp
src/mac/glcanvas.cpp

index 6c1459db388ffb2940d0ab77187f83390d879bd7..0b86e94269243b0e5e550d8cf2846b763bd8eee9 100644 (file)
@@ -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)
index 6c1459db388ffb2940d0ab77187f83390d879bd7..0b86e94269243b0e5e550d8cf2846b763bd8eee9 100644 (file)
@@ -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)