From 29ec5ba68a14b8c75876ce129dd7b3204f8ba503 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 9 Feb 2012 18:35:15 +0100 Subject: Fix crash in qt_init when the XFIXES extension is not available. This happened to me when starting a Qt4 application in VNC (vncserver, vncviewer -via host, on linux). The pointers to the xfixes functions were not being set to 0 when XFIXES is not available, so it would crash later on in the method, in the (null-checked) use of X11->ptrXFixesSelectSelectionInput. Change-Id: Icbeec16e211790ea9d8ebe7e2d96c7a8021214cd Reviewed-by: Lars Knoll --- src/gui/kernel/qapplication_x11.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index d4782f9..256db7d 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -2082,6 +2082,14 @@ void qt_init(QApplicationPrivate *priv, int, X11->use_xfixes = (major >= 1); X11->xfixes_major = major; } + } else { + X11->ptrXFixesQueryExtension = 0; + X11->ptrXFixesQueryVersion = 0; + X11->ptrXFixesSetCursorName = 0; + X11->ptrXFixesSelectSelectionInput = 0; + X11->ptrXFixesCreateRegionFromWindow = 0; + X11->ptrXFixesFetchRegion = 0; + X11->ptrXFixesDestroyRegion = 0; } #endif // QT_NO_XFIXES -- cgit v0.12