diff options
author | Matthew Hoops | 2011-09-29 17:10:13 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-09-29 17:10:13 -0400 |
commit | 5be808fe201f9204fb256112dcf7f89a12e61b6b (patch) | |
tree | ba9673e6084a14ba9629e86d310989a22de3c2de /engines | |
parent | 447b7204f34230044c379022f9a89d14129acbb7 (diff) | |
download | scummvm-rg350-5be808fe201f9204fb256112dcf7f89a12e61b6b.tar.gz scummvm-rg350-5be808fe201f9204fb256112dcf7f89a12e61b6b.tar.bz2 scummvm-rg350-5be808fe201f9204fb256112dcf7f89a12e61b6b.zip |
PEGASUS: Fix use of Common::List::erase
Diffstat (limited to 'engines')
-rwxr-xr-x | engines/pegasus/notification.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/engines/pegasus/notification.cpp b/engines/pegasus/notification.cpp index 9725cfbe1e..5ded610e28 100755 --- a/engines/pegasus/notification.cpp +++ b/engines/pegasus/notification.cpp @@ -66,9 +66,12 @@ void Notification::notifyMe(NotificationReceiver *receiver, tNotificationFlags f } void Notification::cancelNotification(NotificationReceiver *receiver) { - for (tReceiverIterator it = _receivers.begin(); it != _receivers.end(); it++) + for (tReceiverIterator it = _receivers.begin(); it != _receivers.end();) { if (it->receiver == receiver) - _receivers.erase(it); + it = _receivers.erase(it); + else + it++; + } } void Notification::setNotificationFlags(tNotificationFlags flags, tNotificationFlags mask) { @@ -124,9 +127,12 @@ void NotificationManager::addNotification(Notification *notification) { } void NotificationManager::removeNotification(Notification *notification) { - for (tNotificationIterator it = _notifications.begin(); it != _notifications.end(); it++) + for (tNotificationIterator it = _notifications.begin(); it != _notifications.end();) { if ((*it) == notification) - _notifications.erase(it); + it = _notifications.erase(it); + else + it++; + } } void NotificationManager::detachNotifications() { |