fix namespace crash (royqh1979#471) (#483)
This commit is contained in:
parent
0b39a71d02
commit
800d3828c1
|
@ -6071,8 +6071,7 @@ void CppParser::internalInvalidateFile(const QString &fileName)
|
|||
}
|
||||
|
||||
//remove all statements from namespace cache
|
||||
for (auto it=mNamespaces.begin();it!=mNamespaces.end();++it) {
|
||||
QString key = it.key();
|
||||
for (auto it=mNamespaces.begin();it!=mNamespaces.end();) {
|
||||
PStatementList statements = it.value();
|
||||
for (int i=statements->size()-1;i>=0;i--) {
|
||||
PStatement statement = statements->at(i);
|
||||
|
@ -6081,7 +6080,9 @@ void CppParser::internalInvalidateFile(const QString &fileName)
|
|||
}
|
||||
}
|
||||
if (statements->isEmpty()) {
|
||||
mNamespaces.remove(key);
|
||||
it = mNamespaces.erase(it);
|
||||
} else {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
// class inheritance
|
||||
|
|
Loading…
Reference in New Issue