]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix crash on Wayland when closing the mainwindow while another dialog is open
authorElvis Angelaccio <elvis.angelaccio@kde.org>
Sat, 19 Dec 2020 17:43:44 +0000 (18:43 +0100)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Sun, 30 May 2021 22:43:46 +0000 (00:43 +0200)
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

index e7c402b885cbbbdc9fb170fe916a28c91f2f5a2e..4297321fc1e70b6236bd3a5c8f873cd05d5f4b8a 100644 (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