Introduce a weak ptr here to avoid extra addref/releases in this loop. r+sr=bzbarsky@mit.edu on irc.

git-svn-id: svn://10.0.0.236/trunk@145297 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
caillon%returnzero.com
2003-07-28 22:32:31 +00:00
parent cf1f0a43a8
commit 0faa02efe6

View File

@@ -338,16 +338,17 @@ EventTargetIn(nsIPresContext *aPresContext, nsEvent *aEvent,
aPresContext->GetEventStateManager(getter_AddRefs(esm));
nsCOMPtr<nsIContent> c;
esm->GetEventTargetContent(aEvent, getter_AddRefs(c));
while (c) {
if (c == aChild) {
nsIContent *content = c;
while (content) {
if (content == aChild) {
return PR_TRUE;
}
if (c == aStop) {
if (content == aStop) {
break;
}
c = c->GetParent();
content = content->GetParent();
}
return PR_FALSE;
}