S
sam
Hi,
I don't know the correct way to remove an item from a STL list.
The following codes I supposed it works, but generated run-time coredump:
for (l_iter=l_peer_info.begin(); l_iter!=l_peer_info.end(); l_iter++) {
for (m_iter=l_iter->begin(); m_iter!=l_iter->end(); m_iter++) {
int ret = rxx.exec(m_iter->first, macro_parser);
if (ret) {
//(*l_iter).erase(m_iter);
l_peer_info.erase(l_iter);
break;
//continue;
}
....
the result of running the above code is shown error as below:
in free(): error: junk pointer, too high to make sense
Abort (core dumped)
The second method was to remove the commend of the above code and
comment out the uncommented code.
Thanks
Sam
I don't know the correct way to remove an item from a STL list.
The following codes I supposed it works, but generated run-time coredump:
for (l_iter=l_peer_info.begin(); l_iter!=l_peer_info.end(); l_iter++) {
for (m_iter=l_iter->begin(); m_iter!=l_iter->end(); m_iter++) {
int ret = rxx.exec(m_iter->first, macro_parser);
if (ret) {
//(*l_iter).erase(m_iter);
l_peer_info.erase(l_iter);
break;
//continue;
}
....
the result of running the above code is shown error as below:
in free(): error: junk pointer, too high to make sense
Abort (core dumped)
The second method was to remove the commend of the above code and
comment out the uncommented code.
Thanks
Sam