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
bb10
Lars Knoll 2011-06-20 12:10:26 +02:00
parent 7a64f12cfe
commit 1c86896f53
1 changed files with 2 additions and 1 deletions

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;