Skip to content
Snippets Groups Projects
Commit e4aba1d6 authored by Dor Laor's avatar Dor Laor
Browse files

Bug fix - after remove an element from the list the iterator is invalid

parent 65ecb608
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,9 @@ DriverFactory::DumpDrivers() {
void
DriverFactory::Destroy() {
for (auto ii = _drivers.begin() ; ii != _drivers.end() ; ii++ )
delete *ii;
for (auto ii = _drivers.begin() ; ii != _drivers.end() ; ii++ ) {
Driver* del_me = *ii;
ii = _drivers.erase(ii);
delete del_me;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment