Fix a memory leak in QXcbConnection.

Change-Id: I2307bf434c53d9321c71609eeacc1f3883bbbb13
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
Jędrzej Nowacki 2011-11-17 16:58:38 +01:00 committed by Qt by Nokia
parent abe5a0a432
commit 2aba4e12ba
2 changed files with 3 additions and 3 deletions

View File

@ -162,7 +162,7 @@ QXcbConnection::QXcbConnection(const char *displayName)
initializeXInput2();
#endif
m_wmSupport = new QXcbWMSupport(this);
m_wmSupport.reset(new QXcbWMSupport(this));
m_keyboard = new QXcbKeyboard(this);
m_clipboard = new QXcbClipboard(this);
m_drag = new QXcbDrag(this);

View File

@ -305,7 +305,7 @@ public:
QXcbClipboard *clipboard() const { return m_clipboard; }
QXcbDrag *drag() const { return m_drag; }
QXcbWMSupport *wmSupport() const { return m_wmSupport; }
QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); }
#ifdef XCB_USE_XLIB
void *xlib_display() const { return m_xlib_display; }
@ -382,7 +382,7 @@ private:
QXcbKeyboard *m_keyboard;
QXcbClipboard *m_clipboard;
QXcbDrag *m_drag;
QXcbWMSupport *m_wmSupport;
QScopedPointer<QXcbWMSupport> m_wmSupport;
#if defined(XCB_USE_XLIB)
void *m_xlib_display;