Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix use of invalidated iterator.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sat, 2 Mar 2019 09:05:58 +0000 (10:05 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sat, 2 Mar 2019 09:05:58 +0000 (10:05 +0100)
src/surf/network_ib.cpp

index 19bb9cd..344cf11 100644 (file)
@@ -213,8 +213,8 @@ void NetworkIBModel::updateIBfactors(NetworkAction* action, IBNode* from, IBNode
     to->nbActiveCommsDown--;
     for (std::vector<ActiveComm*>::iterator it = from->ActiveCommsUp.begin(); it != from->ActiveCommsUp.end(); ++it) {
       if ((*it)->action == action) {
     to->nbActiveCommsDown--;
     for (std::vector<ActiveComm*>::iterator it = from->ActiveCommsUp.begin(); it != from->ActiveCommsUp.end(); ++it) {
       if ((*it)->action == action) {
-        from->ActiveCommsUp.erase(it);
         delete *it;
         delete *it;
+        from->ActiveCommsUp.erase(it);
         break;
       }
     }
         break;
       }
     }