txCore-include
author Benjamin Smedberg <benjamin@smedbergs.us>
Sat, 26 Jul 2008 22:49:39 -0400
changeset 167 a4da40849f5436e629c5732f4368c6c48189637f
permissions -rw-r--r--
State as of now

diff --git a/content/xslt/src/base/txCore.h b/content/xslt/src/base/txCore.h
--- a/content/xslt/src/base/txCore.h
+++ b/content/xslt/src/base/txCore.h
@@ -44,6 +44,7 @@
 #include "nsTraceRefcnt.h"
 #include "prtypes.h"
 #include "txDouble.h"
+#include "nsISupportsUtils.h"
 
 class nsAString;
 
diff --git a/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp b/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp
--- a/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp
+++ b/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp
@@ -348,15 +348,6 @@ txXPathNode::txXPathNode(const txXPathNo
     MOZ_COUNT_CTOR(txXPathNode);
     if (mRefCountRoot) {
         NS_ADDREF(Root());
-    }
-}
-
-txXPathNode::~txXPathNode()
-{
-    MOZ_COUNT_DTOR(txXPathNode);
-    if (mRefCountRoot) {
-        nsINode *root = Root();
-        NS_RELEASE(root);
     }
 }
 
diff --git a/content/xslt/src/xpath/txXPathNode.h b/content/xslt/src/xpath/txXPathNode.h
--- a/content/xslt/src/xpath/txXPathNode.h
+++ b/content/xslt/src/xpath/txXPathNode.h
@@ -56,15 +56,20 @@ typedef nsIDOMNode txXPathNodeType;
 typedef nsIDOMNode txXPathNodeType;
 #endif
 
-class txXPathNode
+class txXPathNode : public XPCOMGCObject
 {
 public:
+    using XPCOMGCObject::operator new;
+    static void* operator new(size_t size, txXPathNode *loc) NS_GCALLOCATOR
+    {
+        return loc;
+    }
+
     PRBool operator==(const txXPathNode& aNode) const;
     PRBool operator!=(const txXPathNode& aNode) const
     {
         return !(*this == aNode);
     }
-    ~txXPathNode();
 
 private:
     friend class txNodeSet;