Bug 1438397 - Don't process RepaintSelection() if the presshell is being destroyed. r=masayuki
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Thu, 15 Feb 2018 11:21:32 +0900
changeset 403918 a281dd360b0a92a4eb0492a88170ddbf2a30ec74
parent 403917 ac9440a7256caa96064e9a7b259c89630a5aa50e
child 403919 1ab257b6d0d94649056595dcce6d0c133b6ff7ed
push id99885
push userapavel@mozilla.com
push dateThu, 15 Feb 2018 10:38:09 +0000
treeherdermozilla-inbound@99495614cba7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1438397
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1438397 - Don't process RepaintSelection() if the presshell is being destroyed. r=masayuki MozReview-Commit-ID: 4vihEDBw7BH
editor/libeditor/EditorBase.cpp
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -5243,16 +5243,21 @@ public:
   explicit RepaintSelectionRunner(nsISelectionController* aSelectionController)
     : Runnable("RepaintSelectionRunner")
     , mSelectionController(aSelectionController)
   {
   }
 
   NS_IMETHOD Run() override
   {
+    nsCOMPtr<nsIPresShell> shell = do_QueryInterface(mSelectionController);
+    if (!shell || shell->IsDestroying()) {
+      return NS_OK;
+    }
+
     mSelectionController->RepaintSelection(
                             nsISelectionController::SELECTION_NORMAL);
     return NS_OK;
   }
 
 private:
   nsCOMPtr<nsISelectionController> mSelectionController;
 };