Bug 1556441 - Don't call StopObservering when destroying a BackgroundClipRenderingObserver since we know the frame is going away anyway. r=jwatt
authorMatt Woodrow <mwoodrow@mozilla.com>
Thu, 27 Jun 2019 10:01:15 +0000
changeset 543167 ae0ec3d4ed204dc4645b6a79989e3ec6fc0392ce
parent 543166 bba53c82b50b905bf858e0be059da123cd5e84c2
child 543168 5f0520d9b5dedf9e41b64862f1df0507063f4c37
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs1556441
milestone69.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 1556441 - Don't call StopObservering when destroying a BackgroundClipRenderingObserver since we know the frame is going away anyway. r=jwatt Differential Revision: https://phabricator.services.mozilla.com/D35971
layout/svg/SVGObserverUtils.cpp
--- a/layout/svg/SVGObserverUtils.cpp
+++ b/layout/svg/SVGObserverUtils.cpp
@@ -534,17 +534,19 @@ class SVGMozElementObserver final : publ
  */
 class BackgroundClipRenderingObserver : public SVGRenderingObserver {
  public:
   explicit BackgroundClipRenderingObserver(nsIFrame* aFrame) : mFrame(aFrame) {}
 
   NS_DECL_ISUPPORTS
 
  private:
-  virtual ~BackgroundClipRenderingObserver() { StopObserving(); }
+  // We do not call StopObserving() since the observing and observed element
+  // are the same element (and because we could crash - see bug 1556441).
+  virtual ~BackgroundClipRenderingObserver() = default;
 
   Element* GetReferencedElementWithoutObserving() final {
     return mFrame->GetContent()->AsElement();
   }
 
   void OnRenderingChange() final;
 
   /**