Bug 420089 - Crash [@ nsFormFillController::SetPopupOpen] with changing body style on focus and more. r=smaug
authorMartijn Wargers <martijn.martijn@gmail.com>
Mon, 13 Apr 2009 10:35:18 +0200
changeset 27255 68cfe7fb9f31637987b17c15477ab44377204240
parent 27254 f5083efca9bf4b75e25b017ac464918372a95f4f
child 27256 66c661e575a9b891fa84bb1c6b85cda08a6d76a3
push id6453
push userdgottwald@mozilla.com
push dateMon, 13 Apr 2009 08:35:41 +0000
treeherdermozilla-central@68cfe7fb9f31 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs420089
milestone1.9.2a1pre
Bug 420089 - Crash [@ nsFormFillController::SetPopupOpen] with changing body style on focus and more. r=smaug
toolkit/components/satchel/src/nsFormFillController.cpp
--- a/toolkit/components/satchel/src/nsFormFillController.cpp
+++ b/toolkit/components/satchel/src/nsFormFillController.cpp
@@ -211,18 +211,19 @@ nsFormFillController::SetPopupOpen(PRBoo
       nsCOMPtr<nsIDocShell> docShell = GetDocShellForInput(mFocusedInput);
       NS_ENSURE_STATE(docShell);
       nsCOMPtr<nsIPresShell> presShell;
       docShell->GetPresShell(getter_AddRefs(presShell));
       NS_ENSURE_STATE(presShell);
       presShell->ScrollContentIntoView(content,
                                        NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,
                                        NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE);
-
-      mFocusedPopup->OpenAutocompletePopup(this, mFocusedInput);
+      // mFocusedPopup can be destroyed after ScrollContentIntoView, see bug 420089
+      if (mFocusedPopup)
+        mFocusedPopup->OpenAutocompletePopup(this, mFocusedInput);
     } else
       mFocusedPopup->ClosePopup();
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP