hi all:
      WTF::Hashmap::iterator uses WTF::HashTable::iterator as its m_impl.
When you call 'remove( oldIter )', the current 'iter' may be changed. And
it's not about memory reallocation or element shift, but it's because the
member variable 'm_table' in WTF::HashTable::iterator may become NULL
if there is only one entry in the HashMap before you call remove( olditer ).

    So, how can I delete an element of a HashMap when I traversing the
container? e.x.

while( iter ) {
      oldIt = iter;
      ++iter;
      remove( oldIT ); // not always safe
}

thx
_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to