Fix invalid iterator usage in Application::close_XML_File
The iterator 'b' is invalidated by calling erase(b), which means that the subsequent call to ++b results in undefined behavior. This was identified by segfaults in the Matlab unit test on OS X.
This commit is contained in:
parent
2256cd03de
commit
8dcde36d20
1 changed files with 1 additions and 1 deletions
|
|
@ -306,8 +306,8 @@ void Application::close_XML_File(const std::string& file)
|
|||
for (; b != e; ++b) {
|
||||
b->second.first->unlock();
|
||||
delete b->second.first;
|
||||
xmlfiles.erase(b->first);
|
||||
}
|
||||
xmlfiles.clear();
|
||||
} else if (xmlfiles.find(file) != xmlfiles.end()) {
|
||||
xmlfiles[file].first->unlock();
|
||||
delete xmlfiles[file].first;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue