diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2011-06-20 12:10:26 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2011-06-20 13:32:20 +0200 |
commit | 1c86896f53e131f7b72c9e194e92c6fd50a20e73 (patch) | |
tree | d117066a68a24ba2e856afc0f18b5368980962bf /src | |
parent | 7a64f12cfe03b673ebb3c5e9e0396c6a504620d8 (diff) |
Don't crash if Clipboard and Selection hold the same mimedate
Cliboard and Selection can hold the same QMimeData object.
Don't delete the mimedata in this case before when clearing
only one of them.
Reviewed-by: Samuel
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbclipboard.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbclipboard.cpp b/src/plugins/platforms/xcb/qxcbclipboard.cpp index 31f82443de..550b8cbd73 100644 --- a/src/plugins/platforms/xcb/qxcbclipboard.cpp +++ b/src/plugins/platforms/xcb/qxcbclipboard.cpp @@ -272,7 +272,8 @@ void QXcbClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode) xcb_window_t newOwner = XCB_NONE; - delete m_clientClipboard[mode]; + if (m_clientClipboard[QClipboard::Clipboard] != m_clientClipboard[QClipboard::Selection]) + delete m_clientClipboard[mode]; m_clientClipboard[mode] = 0; m_timestamp[mode] = XCB_CURRENT_TIME; |