Verified Commit 61c7f73a authored by Romain De Laage De Bellefaye's avatar Romain De Laage De Bellefaye 🌳
Browse files

Resolve segfault when switching automaton

parent 03fd0373
Pipeline #79682 passed with stage
in 15 seconds
......@@ -47,12 +47,15 @@ void EnsembleEtat::initEtat(const Etat* init_etats){
}
void EnsembleEtat::reset(){
if (ensEtats != nullptr){
for(auto it : ensEtats){
delete it;
}
nbEtats=0;
}
if (ensEtats != nullptr){
for(auto& it: ensEtats) {
if (it != nullptr) {
delete it;
it = nullptr;
}
}
nbEtats=0;
}
};
//méthodes de la classe Etat
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment