]> cloud.milkyroute.net Git - dolphin.git/commitdiff
[dolphinview] Disconnect modelChanged when destructing
authorFelix Ernst <fe.a.ernst@gmail.com>
Thu, 15 Sep 2022 12:15:31 +0000 (14:15 +0200)
committerFelix Ernst <fe.a.ernst@gmail.com>
Thu, 15 Sep 2022 12:15:31 +0000 (14:15 +0200)
Deleting DolphinView deletes KItemListContainer, which deletes
KItemListController, which emits modelChanged, which causes a
signal delivery to the already destroyed DolphinView

This is never good, and in Qt6 causes an assert
(https://codereview.qt-project.org/c/qt/qtbase/+/381860).

Co-authored-by: Nicolas Fella <nicolas.fella@gmx.de>
src/views/dolphinview.cpp

index a00d485c85dc3c4008712a686915cb1df09eeb67..ea2956924b722fc8c76b6de6f6a36d161e04b362 100644 (file)
@@ -235,6 +235,7 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) :
 
 DolphinView::~DolphinView()
 {
+    disconnect(m_container->controller(), &KItemListController::modelChanged, this, &DolphinView::slotModelChanged);
 }
 
 QUrl DolphinView::url() const