[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/kdesktop/lock
From:       Luboš Luňák <l.lunak () kde ! org>
Date:       2005-06-27 9:41:26
Message-ID: 1119865286.553803.23718.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 429332 by lunakl:

Fix the last commit - check return value, and also add XFree().
BUG: 73813



 M  +11 -8     lockprocess.cc  


--- trunk/KDE/kdebase/kdesktop/lock/lockprocess.cc #429331:429332
@@ -402,14 +402,17 @@
     if( mOpenGLVisual )
     {
         int attribs[] = { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, x11Depth(), \
                None };
-        XVisualInfo* i = glXChooseVisual( x11Display(), x11Screen(), attribs );
-        visual = i->visual;
-        static Colormap colormap = 0;
-        if( colormap != 0 )
-            XFreeColormap( x11Display(), colormap );
-        colormap = XCreateColormap( x11Display(), RootWindow( x11Display(), \
                x11Screen()), visual, AllocNone );
-        attrs.colormap = colormap;
-        flags |= CWColormap;
+        if( XVisualInfo* i = glXChooseVisual( x11Display(), x11Screen(), attribs ))
+        {
+            visual = i->visual;
+            static Colormap colormap = 0;
+            if( colormap != 0 )
+                XFreeColormap( x11Display(), colormap );
+            colormap = XCreateColormap( x11Display(), RootWindow( x11Display(), \
x11Screen()), visual, AllocNone ); +            attrs.colormap = colormap;
+            flags |= CWColormap;
+            XFree( i );
+        }
     }
 #endif
     Window w = XCreateWindow( x11Display(), RootWindow( x11Display(), x11Screen()),


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic