Skip to content

Commit

Permalink
fix: assertion error caused by beginRemoveRows
Browse files Browse the repository at this point in the history
系统监视器在v23 bate2系统中启动时会报错:
ASSERT: "last < rowCount(parent)" in file itemmodels/qabstractitemmodel.cpp
是因为ProcessTableModel在调用beginRemoveRows时未检查当前总的row数量

Log:
  • Loading branch information
myml committed Sep 22, 2023
1 parent 7a178d6 commit 891f6cf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions deepin-system-monitor-main/model/process_table_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ void ProcessTableModel::updateProcessListWithUserSpecified()
ProcessSet *processSet = ProcessDB::instance()->processSet();
const QList<pid_t> &newpidlst = processSet->getPIDList();

beginRemoveRows({}, 0, m_procIdList.size());
endRemoveRows();
if (rowCount() > 0) {
beginRemoveRows({}, 0, rowCount() - 1);
endRemoveRows();
}
m_procIdList.clear();
m_processList.clear();
int raw;
Expand Down

0 comments on commit 891f6cf

Please sign in to comment.