Skip to content

Commit 41e37b4

Browse files
committed
fix: incorrectly removed window in AbstractWindowMonitor
AbstractWindowMonitor 在跟踪移除窗口事件时,对 model 状态的维护不正确, 实际移除的元素数量和beginRemoveRows中传递的数量不匹配,可能导致模型状态 有误导致的潜在崩溃或视图错误. 另外,也将原本的 removeOne 调整为 removeAt,以便准确移除给定位置的元素, 而非首个匹配但不一定在给定位置的元素. Log:
1 parent 225dc72 commit 41e37b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

panels/dock/taskmanager/abstractwindowmonitor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ void AbstractWindowMonitor::destroyWindow(AbstractWindow * window)
101101
if (pos == -1)
102102
return;
103103

104-
beginRemoveRows(QModelIndex(), pos, pos + 1);
105-
m_trackedWindows.removeOne(window);
104+
beginRemoveRows(QModelIndex(), pos, pos);
105+
m_trackedWindows.removeAt(pos);
106106
endRemoveRows();
107107
}
108108

0 commit comments

Comments
 (0)