deathgrip the event listener manager in HandleEvent. partial fix for bug 21397. r:hyatt a:chofmann

This commit is contained in:
danm%netscape.com 1999-12-14 02:29:34 +00:00
parent fe29f5d7a5
commit 4447892c87
2 changed files with 10 additions and 0 deletions

View File

@ -671,6 +671,11 @@ nsresult nsEventListenerManager::HandleEvent(nsIPresContext* aPresContext,
aFlags |= (NS_EVENT_FLAG_BUBBLE | NS_EVENT_FLAG_CAPTURE);
}
/* Without this addref, certain events, notably ones bound to
keys which cause window deletion, can destroy this object
before we're ready. */
nsCOMPtr<nsIEventListenerManager> kungFuDeathGrip(this);
switch(aEvent->message) {
case NS_MOUSE_LEFT_BUTTON_DOWN:
case NS_MOUSE_MIDDLE_BUTTON_DOWN:

View File

@ -671,6 +671,11 @@ nsresult nsEventListenerManager::HandleEvent(nsIPresContext* aPresContext,
aFlags |= (NS_EVENT_FLAG_BUBBLE | NS_EVENT_FLAG_CAPTURE);
}
/* Without this addref, certain events, notably ones bound to
keys which cause window deletion, can destroy this object
before we're ready. */
nsCOMPtr<nsIEventListenerManager> kungFuDeathGrip(this);
switch(aEvent->message) {
case NS_MOUSE_LEFT_BUTTON_DOWN:
case NS_MOUSE_MIDDLE_BUTTON_DOWN: