Bug 637242, patch 1 of 3: Fix ref-counting bug. r=dbaron
authorMats Palmgren <matspal@gmail.com>
Sun, 13 Jul 2014 13:01:43 +0000
changeset 215667 7e06e39e4dcd38f71b0a5b9cd823e4af3d4a9376
parent 215666 d85b064039fca9decc8f019b4624f9f20d92da00
child 215668 e8b133697ef9f3f795f9104dd840d2731c3086c3
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs637242
milestone33.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 637242, patch 1 of 3: Fix ref-counting bug. r=dbaron
layout/style/nsRuleNode.cpp
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -8950,17 +8950,17 @@ nsRuleNode::Sweep()
   // Call sweep on the children, since some may not be marked, and
   // remove any deleted children from the child lists.
   if (HaveChildren()) {
     uint32_t childrenDestroyed;
     if (ChildrenAreHashed()) {
       PLDHashTable *children = ChildrenHash();
       uint32_t oldChildCount = children->entryCount;
       PL_DHashTableEnumerate(children, SweepRuleNodeChildren, nullptr);
-      childrenDestroyed = children->entryCount - oldChildCount;
+      childrenDestroyed = oldChildCount - children->entryCount;
     } else {
       childrenDestroyed = 0;
       for (nsRuleNode **children = ChildrenListPtr(); *children; ) {
         nsRuleNode *next = (*children)->mNextSibling;
         if ((*children)->Sweep()) {
           // This rule node was destroyed, so implicitly advance by
           // making *children point to the next entry.
           *children = next;