summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2010-11-29 22:33:25 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2010-11-29 22:33:25 (GMT)
commit3aabc92c72bdd9f7e7bc67dd22dae203033e958a (patch)
tree18e49bcfc40c1ff6651547c2d45a8731c8778699 /src
parent2ca63430ff464ab52f955dda3603a6deead4bb1a (diff)
downloadQt-3aabc92c72bdd9f7e7bc67dd22dae203033e958a.zip
Qt-3aabc92c72bdd9f7e7bc67dd22dae203033e958a.tar.gz
Qt-3aabc92c72bdd9f7e7bc67dd22dae203033e958a.tar.bz2
Fix resource leak in QEgl::getCompatibleVisualld()
Contributed patch. Task-number: QT-4335 Reviewed-by: Daniel Pope
Diffstat (limited to 'src')
-rw-r--r--src/gui/egl/qegl_x11.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/egl/qegl_x11.cpp b/src/gui/egl/qegl_x11.cpp
index 15cc109..29415ed 100644
--- a/src/gui/egl/qegl_x11.cpp
+++ b/src/gui/egl/qegl_x11.cpp
@@ -165,8 +165,10 @@ VisualID QEgl::getCompatibleVisualId(EGLConfig config)
if (chosenVisualInfo) {
// Skip size checks if implementation supports non-matching visual
// and config (http://bugreports.qt.nokia.com/browse/QTBUG-9444).
- if (QEgl::hasExtension("EGL_NV_post_convert_rounding"))
+ if (QEgl::hasExtension("EGL_NV_post_convert_rounding")) {
+ XFree(chosenVisualInfo);
return visualId;
+ }
int visualRedSize = countBits(chosenVisualInfo->red_mask);
int visualGreenSize = countBits(chosenVisualInfo->green_mask);