Very interesting issue.
Try this:
- Change remObserver to null out the entry, rather than just removing it (and invalidating the list iterators).
-
Change your notifyAll loop to be:
for (all registered observers) { if (observer) observer->notify(); }
-
Add another loop at the end of notifyAll to remove all null entries from your observer list