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:
parent
7a64f12cfe
commit
1c86896f53
@ -272,6 +272,7 @@ void QXcbClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
|
|||||||
|
|
||||||
xcb_window_t newOwner = XCB_NONE;
|
xcb_window_t newOwner = XCB_NONE;
|
||||||
|
|
||||||
|
if (m_clientClipboard[QClipboard::Clipboard] != m_clientClipboard[QClipboard::Selection])
|
||||||
delete m_clientClipboard[mode];
|
delete m_clientClipboard[mode];
|
||||||
m_clientClipboard[mode] = 0;
|
m_clientClipboard[mode] = 0;
|
||||||
m_timestamp[mode] = XCB_CURRENT_TIME;
|
m_timestamp[mode] = XCB_CURRENT_TIME;
|
||||||
|
Loading…
Reference in New Issue
Block a user