mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-13 10:25:01 +00:00
Fix for focus crash bugs 107844, 104297, and 109645. Make sure the window doesn't get deleted out from under us. r=saari, sr=blizzard.
This commit is contained in:
parent
68c2123b34
commit
5491e0a08e
@ -575,6 +575,11 @@ nsWebShellWindow::HandleEvent(nsGUIEvent *aEvent)
|
||||
nsCOMPtr<nsIDOMWindowInternal> focusedWindow;
|
||||
focusController->GetFocusedWindow(getter_AddRefs(focusedWindow));
|
||||
if (focusedWindow) {
|
||||
// It's possible for focusing the window to cause it to close.
|
||||
// To avoid holding a pointer to deleted memory, keep a reference
|
||||
// on eventWindow. -bryner
|
||||
nsCOMPtr<nsIWebShellWindow> kungFuDeathGrip(eventWindow);
|
||||
|
||||
focusController->SetSuppressFocus(PR_TRUE, "Activation Suppression");
|
||||
domWindow->Focus(); // This sets focus, but we'll ignore it.
|
||||
// A subsequent activate will cause us to stop suppressing.
|
||||
|
Loading…
Reference in New Issue
Block a user