Skip to content

Commit

Permalink
Wayland: Avoid deleting clipboard data while accessing it
Browse files Browse the repository at this point in the history
Fixes SIGSEGV when accessing data that is being deleted in another
thread.
  • Loading branch information
hluk committed Nov 7, 2022
1 parent 1ed4472 commit e72b2af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/platform/x11/systemclipboard/waylandclipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,10 @@ class DataControlSource : public QObject, public QtWayland::zwlr_data_control_so

~DataControlSource()
{
delete m_mimeData;
m_mimeData = nullptr;
if (m_mimeData) {
m_mimeData->deleteLater();
m_mimeData = nullptr;
}
if ( isInitialized() )
destroy();
}
Expand Down

0 comments on commit e72b2af

Please sign in to comment.