From 1f4b84f69f13edd10300d035321623291c5d073e Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Mon, 2 Feb 2015 11:08:59 +0100 Subject: QXcbClipboard: don't hold on to the screen pointer Remove the QXcbClipboard::m_screen member variable and make it use connection()->primaryScreen() instead. The clipboard is created in the QXcbConnection constructor, and QXcbClipboard::m_screen was set to the primary screen at the time of construction. If the primary screen later gets disconnected, m_screen ends up pointing to a non-existing screen. Change-Id: I2d23106673d0ba013056d4dbb7078acdf6f9bc7c Reviewed-by: Shawn Rutledge Reviewed-by: Laszlo Agocs --- src/plugins/platforms/xcb/qxcbclipboard.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/plugins/platforms/xcb/qxcbclipboard.h') diff --git a/src/plugins/platforms/xcb/qxcbclipboard.h b/src/plugins/platforms/xcb/qxcbclipboard.h index 5993eea326..a12464928c 100644 --- a/src/plugins/platforms/xcb/qxcbclipboard.h +++ b/src/plugins/platforms/xcb/qxcbclipboard.h @@ -59,7 +59,7 @@ public: bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; - QXcbScreen *screen() const { return m_screen; } + QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); @@ -91,8 +91,6 @@ private: xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; - QXcbScreen *m_screen; - // Selection and Clipboard QXcbClipboardMime *m_xClipboard[2]; QMimeData *m_clientClipboard[2]; -- cgit v1.2.3