The context should probably be first unset from being current,

and also fix a possible leak.


svn path=/trunk/KDE/kdebase/workspace/; revision=764823
This commit is contained in:
Luboš Luňák 2008-01-22 17:04:41 +00:00
parent cd8e69aff3
commit 52f86e4a47
2 changed files with 7 additions and 9 deletions

View file

@ -133,27 +133,23 @@ void CompositingPrefs::detect()
if( hasglx13 )
oldreaddrawable = glXGetCurrentReadDrawable();
if( createGLXContext() )
if( initGLXContext() )
{
detectDriverAndVersion();
applyDriverSpecificOptions();
deleteGLXContext();
}
if( hasglx13 )
{
glXMakeContextCurrent( display(), olddrawable, oldreaddrawable, oldcontext );
}
else
{
glXMakeCurrent( display(), olddrawable, oldcontext );
}
deleteGLXContext();
#endif
}
bool CompositingPrefs::createGLXContext()
bool CompositingPrefs::initGLXContext()
{
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
mGLContext = NULL;
KXErrorHandler handler;
// Most of this code has been taken from glxinfo.c
QVector<int> attribs;
@ -204,6 +200,8 @@ bool CompositingPrefs::createGLXContext()
void CompositingPrefs::deleteGLXContext()
{
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
if( mGLContext == NULL )
return;
glXDestroyContext( display(), mGLContext );
XDestroyWindow( display(), mGLWindow );
#endif

View file

@ -70,7 +70,7 @@ protected:
void applyDriverSpecificOptions();
static bool detectXgl();
bool createGLXContext();
bool initGLXContext();
void deleteGLXContext();