summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbintegration.cpp
diff options
context:
space:
mode:
authorSandro Mani <manisandro@gmail.com>2015-02-16 10:22:14 +0100
committerShawn Rutledge <shawn.rutledge@digia.com>2015-02-25 12:14:51 +0000
commitdf39295f23c7d9ead8481a95b9c78caaff1e8bc8 (patch)
treeb1b446c6635886317153fee80e72b89251377722 /src/plugins/platforms/xcb/qxcbintegration.cpp
parentd56879722618e8b31749aacb78e33a3f215d43f6 (diff)
Have XCB/Windows platform integration classes keep their own instance pointer
Through the chain of code called by QPlatformIntegrationFactory::create, there are cases where QGuiApplicationPrivate::platform_integration is accessed (typically through QGuiApplicationPrivate::platformIntegration()) before the call to QPlatformIntegrationFactory::create has returned. Change-Id: I7805b72be5b56aed5cb8ce30cb908743c9b1f91b Task-number: QTBUG-44388 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbintegration.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index 2e9ba0e8c5..3f497996d8 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -110,11 +110,15 @@ static bool runningUnderDebugger()
#endif
}
+QXcbIntegration *QXcbIntegration::m_instance = Q_NULLPTR;
+
QXcbIntegration::QXcbIntegration(const QStringList &parameters, int &argc, char **argv)
: m_services(new QGenericUnixServices)
, m_instanceName(0)
, m_canGrab(true)
{
+ m_instance = this;
+
qRegisterMetaType<QXcbWindow*>();
#ifdef XCB_USE_XLIB
XInitThreads();
@@ -179,6 +183,7 @@ QXcbIntegration::QXcbIntegration(const QStringList &parameters, int &argc, char
QXcbIntegration::~QXcbIntegration()
{
qDeleteAll(m_connections);
+ m_instance = Q_NULLPTR;
}
QPlatformWindow *QXcbIntegration::createPlatformWindow(QWindow *window) const