Fix crash on Wayland when closing the mainwindow while another dialog is open

For some reason on Wayland `QClipboad::dataChanged` can be emitted after
the main window gets deleted. In particular this happens when closing the
main window while another dialog is open.

Since we are closing the window, we can just disconnect this signal and
prevent this crash from ever happening.
This commit is contained in:
Elvis Angelaccio 2020-12-19 18:43:44 +01:00
parent ec3c196e5a
commit 2f3d8c5c96

View file

@ -204,6 +204,8 @@ DolphinMainWindow::DolphinMainWindow() :
DolphinMainWindow::~DolphinMainWindow()
{
// This fixes a crash on Wayland when closing the mainwindow while another dialog is open.
disconnect(QGuiApplication::clipboard(), &QClipboard::dataChanged, this, &DolphinMainWindow::updatePasteAction);
}
QVector<DolphinViewContainer*> DolphinMainWindow::viewContainers() const