Bonjour,
Voila je n'arrive pas à voir pourquoi lorsque je fais un erase puis un delete sur ma map mon application plante. Voici le petit bout de code :
Ce sont les deux dernières lignes de la méthode qui foire. Quelqu'un aurait une idée ? Merci d'avance
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 void Image::_add_span (int old_id_span, int new_id_span) throw () { std::map<int, Span *>::iterator old_it = this->_listSpan.find (old_id_span); std::map<int, Span *>::const_iterator new_it = this->_listSpan.find (new_id_span); PersoTypes::ListPoints old_pixels = old_it->second->content (); for (PersoTypes::ListPoints::const_iterator it=old_pixels.begin ();it!=old_pixels.end ();it++) { this->_pixel (*it).id_span (new_id_span); new_it->second->content ().push_back (*it); } this->_listSpan.erase (old_it); delete old_it->second; }
Partager