X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/0d72fb12dc9a570be45e2f25320ac49f604c3ed2..fc802b7aea75e90b19cd22d3e5e752620a416af8:/Constructor/src/workplace.cpp diff --git a/Constructor/src/workplace.cpp b/Constructor/src/workplace.cpp index 62757d2..e19ae3b 100644 --- a/Constructor/src/workplace.cpp +++ b/Constructor/src/workplace.cpp @@ -92,20 +92,39 @@ void WorkPlace::delete_line(int _id) { std::list::iterator i = lista_lineas_in.begin(); while ( i != lista_lineas_in.end() ){ - if ( (*i).store->get_id() == _id || (*i).logic->get_id() == _id ) { + if ( (*i).store->get_id() == _id ) { lista_lineas_in.erase(i); i = lista_lineas_in.begin(); } i++; } + + i = lista_lineas_in.begin(); + while ( i != lista_lineas_in.end() ){ + if ( (*i).logic->get_id() == _id ) { + lista_lineas_in.erase(i); + i = lista_lineas_in.begin(); + } + i++; + } + i = lista_lineas_out.begin(); while ( i != lista_lineas_out.end() ){ - if ( (*i).store->get_id() == _id || (*i).logic->get_id() == _id ) { + if ( (*i).store->get_id() == _id ) { lista_lineas_out.erase(i); i = lista_lineas_out.begin(); } i++; } + i = lista_lineas_out.begin(); + while ( i != lista_lineas_out.end() ){ + if ( (*i).logic->get_id() == _id ) { + lista_lineas_out.erase(i); + i = lista_lineas_out.begin(); + } + i++; + } + } void WorkPlace::update_logic_position()