Skip to content

Commit ebdeab1

Browse files
committed
fix: clear more members in SourceCodeModel::clear
Otherwise we might not have any highlighted text yet the model still assumes we have a bunch of lines, possibly leading to crashes later on. Relates-To: #702
1 parent 0d216a5 commit ebdeab1

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/models/sourcecodemodel.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,16 @@ SourceCodeModel::~SourceCodeModel() = default;
3535
void SourceCodeModel::clear()
3636
{
3737
beginResetModel();
38+
m_validLineNumbers.clear();
3839
m_highlightedText.setText({});
40+
m_selfCosts = {};
41+
m_inclusiveCosts = {};
42+
m_mainSourceFileName.clear();
43+
m_prettySymbol.clear();
44+
m_startLine = 0;
45+
m_numLines = 0;
46+
m_lines.clear();
47+
m_highlightLine = 0;
3948
endResetModel();
4049
}
4150

0 commit comments

Comments
 (0)