summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbclipboard.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-09-27 14:55:09 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-10-02 11:28:00 +0000
commitf43c9697bcae997be3eb6db9504f3d7b64601148 (patch)
treeb2e2b36a3bdd1a9cc5809c31166836dff53c0d1a /src/plugins/platforms/xcb/qxcbclipboard.h
parentd2b4a789c39eb770068b002d2bc9ceb764dedf3d (diff)
Plug QMimeData leaks in QXcbClipboard
QXcbClipboard failed to delete the various QMimeData instances it owns. For m_xClipboard, where the two QXcbClipboardMime instances are never the same, fix the leak by using a scoped instead of a naked pointer. For m_clientClipboard, where the two QMimeData could be identical objects, keep the naked pointers, but delete the objects manually in the QXcbClipboard destructor, paying attention to the case where they're the same object. Change-Id: I5ce0e3e8fcec068aeb344ca806cdf2667378e946 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbclipboard.h')
-rw-r--r--src/plugins/platforms/xcb/qxcbclipboard.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbclipboard.h b/src/plugins/platforms/xcb/qxcbclipboard.h
index 10f07047d8..f9a34f4f3d 100644
--- a/src/plugins/platforms/xcb/qxcbclipboard.h
+++ b/src/plugins/platforms/xcb/qxcbclipboard.h
@@ -92,7 +92,7 @@ private:
QClipboard::Mode modeForAtom(xcb_atom_t atom) const;
// Selection and Clipboard
- QXcbClipboardMime *m_xClipboard[2];
+ QScopedPointer<QXcbClipboardMime> m_xClipboard[2];
QMimeData *m_clientClipboard[2];
xcb_timestamp_t m_timestamp[2];