From e8ef23eee4bdc6df293aeda873cb46760a49968c Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 2 Feb 2015 14:34:37 +0100 Subject: xcb: do not leak window system integration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp | 3 ++- src/plugins/platforms/xcb/qxcbconnection.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3