diff options
Diffstat (limited to 'src/platformsupport/glxconvenience/qglxconvenience.cpp')
-rw-r--r-- | src/platformsupport/glxconvenience/qglxconvenience.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/platformsupport/glxconvenience/qglxconvenience.cpp b/src/platformsupport/glxconvenience/qglxconvenience.cpp index 0c2b757920..8d2e58b57b 100644 --- a/src/platformsupport/glxconvenience/qglxconvenience.cpp +++ b/src/platformsupport/glxconvenience/qglxconvenience.cpp @@ -172,7 +172,8 @@ bool QXcbSoftwareOpenGLEnforcer::forceSoftwareOpenGL = false; template <class T> struct QXlibScopedPointerDeleter { static inline void cleanup(T *pointer) { - XFree(pointer); + if (pointer) + XFree(pointer); } }; @@ -217,6 +218,8 @@ GLXFBConfig qglx_findConfig(Display *display, int screen , QSurfaceFormat format } QXlibPointer<XVisualInfo> visual(glXGetVisualFromFBConfig(display, candidate)); + if (visual.isNull()) + continue; const int actualRed = qPopulationCount(visual->red_mask); const int actualGreen = qPopulationCount(visual->green_mask); |