In _addNames2() you modify the vector by adding a name to it, potentially causing it to do a memory reallocation. When this happens existing iterators are invalidated, so on line 62 you end up dereferencing an invalid iterator.
The simplest solution would be to use an index instead of an iterator in the loop beginning on line 57. Another possible solution would be to use a container that doesn't suffer from this behavior, such as a deque or list.