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
This commit is contained in:
Lars Knoll 2011-06-20 12:10:26 +02:00
parent 7a64f12cfe
commit 1c86896f53

View File

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