Bug 1357872 - nsPresContext is refcounted, so use it so. r=kats, a=lizzard FENNEC_54_0b2_BUILD1 FENNEC_54_0b2_RELEASE FIREFOX_54_0b2_BUILD1 FIREFOX_54_0b2_RELEASE
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Tue, 25 Apr 2017 00:38:33 +0300
changeset 567993 ca3c6131b6eadf753445b3cd7a54e29b41ab11aa
parent 567992 953ebf1c32152dca8b633aa8d5a3fe3e684a56c5
child 567994 b310658e45376956c28bc43905a5490c5f495804
push id55727
push userbmo:jryans@gmail.com
push dateTue, 25 Apr 2017 17:13:51 +0000
reviewerskats, lizzard
bugs1357872
milestone54.0
Bug 1357872 - nsPresContext is refcounted, so use it so. r=kats, a=lizzard
dom/events/TouchEvent.cpp
--- a/dom/events/TouchEvent.cpp
+++ b/dom/events/TouchEvent.cpp
@@ -218,18 +218,18 @@ TouchEvent::PrefEnabled(nsIDocShell* aDo
         // into the cached state. If APZ is enabled, we need to further check
         // based on the widget, which we do below (and don't cache that result).
         sIsTouchDeviceSupportPresent &= gfxPlatform::AsyncPanZoomEnabled();
       }
       enabled = sIsTouchDeviceSupportPresent;
       if (enabled && aDocShell) {
         // APZ might be disabled on this particular widget, in which case
         // TouchEvent support will also be disabled. Try to detect that.
-        nsPresContext* pc = nullptr;
-        aDocShell->GetPresContext(&pc);
+        RefPtr<nsPresContext> pc;
+        aDocShell->GetPresContext(getter_AddRefs(pc));
         if (pc && pc->GetRootWidget()) {
           enabled &= pc->GetRootWidget()->AsyncPanZoomEnabled();
         }
       }
 #else
       enabled = false;
 #endif
     } else {