summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-02-02 14:34:37 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-02-05 10:01:09 +0000
commite8ef23eee4bdc6df293aeda873cb46760a49968c (patch)
tree1529e2aa798880529e0bf484dc775f92ed728bc7 /src/plugins
parentc56da2e8dac67bbed78f5f0504e7df042018122b (diff)
xcb: do not leak window system integration
Destroy the GLX or EGL backend. This also requires fixing an uninitalized member in the native interfaace handler. Besides fixing the leak this will also do eglTerminate on exit, which is very beneficial for proper resource cleanup and avoids "Display is destroyed with resources" warnings on Mesa with debugging enabled. Change-Id: Ibd62d6964e86ac1319abed1f06b478327c348a0e Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp3
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp b/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp
index 78c6fe0ccb..b060c8649d 100644
--- a/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp
@@ -46,8 +46,9 @@
QT_BEGIN_NAMESPACE
QXcbNativeInterfaceHandler::QXcbNativeInterfaceHandler(QXcbNativeInterface *nativeInterface)
+ : m_native_interface(nativeInterface)
{
- nativeInterface->addHandler(this);
+ m_native_interface->addHandler(this);
}
QXcbNativeInterfaceHandler::~QXcbNativeInterfaceHandler()
{
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 56b4a9abda..93914c0cba 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -406,6 +406,8 @@ QXcbConnection::~QXcbConnection()
while (!m_screens.isEmpty())
integration->destroyScreen(m_screens.takeLast());
+ delete m_glIntegration;
+
#ifdef XCB_USE_XLIB
XCloseDisplay((Display *)m_xlib_display);
#else