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
|
//remove all statements from namespace cache
|
||||||
for (auto it=mNamespaces.begin();it!=mNamespaces.end();++it) {
|
for (auto it=mNamespaces.begin();it!=mNamespaces.end();) {
|
||||||
QString key = it.key();
|
|
||||||
PStatementList statements = it.value();
|
PStatementList statements = it.value();
|
||||||
for (int i=statements->size()-1;i>=0;i--) {
|
for (int i=statements->size()-1;i>=0;i--) {
|
||||||
PStatement statement = statements->at(i);
|
PStatement statement = statements->at(i);
|
||||||
|
@ -6081,7 +6080,9 @@ void CppParser::internalInvalidateFile(const QString &fileName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (statements->isEmpty()) {
|
if (statements->isEmpty()) {
|
||||||
mNamespaces.remove(key);
|
it = mNamespaces.erase(it);
|
||||||
|
} else {
|
||||||
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// class inheritance
|
// class inheritance
|
||||||
|
|
Loading…
Reference in New Issue