зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
d974e9c1e6
Коммит
350238438c
|
@ -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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче