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>
This commit is contained in:
Laszlo Agocs 2015-02-02 14:34:37 +01:00
parent c56da2e8da
commit e8ef23eee4
2 changed files with 4 additions and 1 deletions

View File

@ -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()
{

View File

@ -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