Check aHandled after event dispatch before accessing the view's children. b=113121 r=roc+moz sr=attinasi

This commit is contained in:
kmcclusk%netscape.com 2001-12-03 23:37:09 +00:00
Родитель 829746a823
Коммит da0e66d506
1 изменённых файлов: 14 добавлений и 12 удалений

Просмотреть файл

@ -345,18 +345,20 @@ NS_IMETHODIMP nsView::HandleEvent(nsGUIEvent *event, PRUint32 aEventFlags,
event->point.y += trect.y;
}
if (mChildRemoved) {
// a child has been removed as the result of the HandleEvent
// so pick up at the same relative position in the child list.
// We may end up skipping over a child depending on which child
// or the number of children removed from the list, but this should
// not be an issue since it is unusual to have the views destroyed
// while traversing this list and the only negative effect will be
// that the event is dispatched to a view underneath the intended view.
pKid = GetChild(cnt);
} else {
pKid = pKid->GetNextSibling();
}
if (!aHandled) {
if (mChildRemoved) {
// a child has been removed as the result of the HandleEvent
// so pick up at the same relative position in the child list.
// We may end up skipping over a child depending on which child
// or the number of children removed from the list, but this should
// not be an issue since it is unusual to have the views destroyed
// while traversing this list and the only negative effect will be
// that the event is dispatched to a view underneath the intended view.
pKid = GetChild(cnt);
} else {
pKid = pKid->GetNextSibling();
}
}
cnt++;
}
}