Changed the loops in BHandler::_SendNotices() and ::_ValidateHandlers().

See also r20183.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21331 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2007-06-05 13:15:45 +00:00
parent bfab6b7394
commit 2f03d0e0ed

View File

@ -682,14 +682,15 @@ ObserverList::_ValidateHandlers(uint32 what)
vector<const BHandler *>& handlers = fHandlerMap[what];
vector<const BHandler *>::iterator iterator = handlers.begin();
for (; iterator != handlers.end(); iterator++) {
while (iterator != handlers.end()) {
BMessenger target(*iterator);
if (!target.IsValid())
if (!target.IsValid()) {
iterator++;
continue;
}
handlers.erase(iterator);
iterator--;
Add(target, what);
handlers.erase(iterator);
}
}
@ -704,13 +705,14 @@ ObserverList::_SendNotices(uint32 what, BMessage* message)
vector<BMessenger>& messengers = fMessengerMap[what];
vector<BMessenger>::iterator iterator = messengers.begin();
for (; iterator != messengers.end(); iterator++) {
while (iterator != messengers.end()) {
if (!(*iterator).IsValid()) {
messengers.erase(iterator);
continue;
}
(*iterator).SendMessage(message);
iterator++;
}
}