From f60408952398f1855fde51c8d380d0c258b905c2 Mon Sep 17 00:00:00 2001 From: wangfei Date: Tue, 16 Apr 2024 14:38:58 +0800 Subject: [PATCH] fix: loadingIndicator isn't deleted loadingIndicator is deleted after spinner action is deleted Issue: https://github.com/linuxdeepin/developer-center/issues/5747 --- dcc-network-plugin/window/wirelessdevicemodel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dcc-network-plugin/window/wirelessdevicemodel.cpp b/dcc-network-plugin/window/wirelessdevicemodel.cpp index 1b7ef6b1..4b2ae9e9 100644 --- a/dcc-network-plugin/window/wirelessdevicemodel.cpp +++ b/dcc-network-plugin/window/wirelessdevicemodel.cpp @@ -191,6 +191,12 @@ void WirelessDeviceModel::addAccessPoints(QList aps) ItemAction *item = new ItemAction(ap); connect(item->iconAction, &DViewItemAction::triggered, this, &WirelessDeviceModel::onDetailTriggered); + connect(item->spinnerAction, &DViewItemAction::destroyed, this, [item] { + if (item->loadingIndicator) { + delete item->loadingIndicator; + item->loadingIndicator = nullptr; + } + }); m_data.append(item); } // 排序