[PATCH] fix kpovmodeler crash

Helge Deller deller at gmx.de
Thu Dec 18 10:39:09 GMT 2003


Hi,

The following patch fixes startup crashes of kpovmodeler on systems
which don't support OpenGL. Basically it moves the glXCreateContext()
with the pointer "vi" inside the big "if (vi) {...}" part to avoid calling 
glXCreateContext() with vi==NULL. Tested and works. Ok ?


-------------- next part --------------
Index: pmglview.cpp
===================================================================
RCS file: /home/kde/kdegraphics/kpovmodeler/pmglview.cpp,v
retrieving revision 1.38
diff -u -p -r1.38 pmglview.cpp
--- pmglview.cpp	25 Sep 2003 06:21:15 -0000	1.38
+++ pmglview.cpp	18 Dec 2003 10:32:54 -0000
@@ -288,14 +288,15 @@ void PMGLView::initializeGL( )
                                    vi->visual, AllocNone );
                s_pSharedData->m_colormapAllocated = true;
             }
-         }
 
-         // create the context
-         // this context is shared between all gl views!
-         s_pSharedData->m_context = glXCreateContext( display, vi, 0, s_bDirect );
+            // create the context
+            // this context is shared between all gl views!
+            s_pSharedData->m_context = glXCreateContext( display, vi, 0, s_bDirect );
+
+            if( s_pSharedData->m_context != NULL )
+               kdDebug( PMArea ) << "PMGLView: glx context created\n";
 
-         if( s_pSharedData->m_context != NULL )
-            kdDebug( PMArea ) << "PMGLView: glx context created\n";
+         }
       }
    }
 


More information about the kde-core-devel mailing list