From 2f3d8c5c9664f66ff7922ad7fd612f65182c75d0 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sat, 19 Dec 2020 18:43:44 +0100 Subject: [PATCH] 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. --- src/dolphinmainwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index e7c402b88..4297321fc 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -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 DolphinMainWindow::viewContainers() const