I was experiencing a crash in this loop on deleting a contact which was present in the recent contacts list.  I rewrote the loop to use c++ iterators, and the crash no longer occurs.  I can't see anything wrong with the old loop, although I'm not very familiar with the java-style iterator patterns...