Skip to content

Commit

Permalink
fix: wild pointer for networkDetails
Browse files Browse the repository at this point in the history
QList's iterator is damaged when removed one item.
  • Loading branch information
18202781743 committed Apr 7, 2024
1 parent d3e6941 commit e67bd2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/realize/networkinterprocesser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ void NetworkInterProcesser::updateNetworkDetails()
}

// 删除不在设备列表中的项
for (NetworkDetails *detail : m_networkDetails) {
const auto details = m_networkDetails;
for (NetworkDetails *detail : details) {
if (!devicePaths.contains(detail->devicePath())) {
m_networkDetails.removeOne(detail);
delete detail;
Expand Down

0 comments on commit e67bd2b

Please sign in to comment.