Bug 1386110 - Use a strong reference for ManualNAC. r=masayuki, a=lizzard
authorBobby Holley <bobbyholley@gmail.com>
Wed, 02 Aug 2017 11:59:35 -0700
changeset 423496 2fc56beba60d733e0e6b8f2b5b8b4c912897ccfd
parent 423495 ce1a65cec332f8c075e9fe9242a0656093e0b91b
child 423497 5cd93684772685fd5968f008dadf3725dfe47ce4
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki, lizzard
bugs1386110
milestone56.0
Bug 1386110 - Use a strong reference for ManualNAC. r=masayuki, a=lizzard This is belt-and-suspenders. MozReview-Commit-ID: H1W7RZeGQYy
dom/base/nsContentUtils.h
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -195,17 +195,20 @@ struct EventNameMapping
 };
 
 typedef bool (*CallOnRemoteChildFunction) (mozilla::dom::TabParent* aTabParent,
                                            void* aArg);
 
 namespace mozilla {
 // 16 seems to be the maximum number of manual NAC nodes that editor
 // creates for a given element.
-typedef AutoTArray<mozilla::dom::Element*,16> ManualNAC;
+//
+// These need to be manually removed by the machinery that sets the NAC,
+// otherwise we'll leak.
+typedef AutoTArray<RefPtr<mozilla::dom::Element>,16> ManualNAC;
 }
 
 class nsContentUtils
 {
   friend class nsAutoScriptBlockerSuppressNodeRemoved;
   typedef mozilla::dom::Element Element;
   typedef mozilla::TimeDuration TimeDuration;