xbl-gcobjects
author Benjamin Smedberg <benjamin@smedbergs.us>
Sat, 26 Jul 2008 22:49:39 -0400
changeset 167 a4da40849f5436e629c5732f4368c6c48189637f
parent 162 3ae1ca70680d55840cbf5a60088ebaebfe2bddc5
permissions -rw-r--r--
State as of now

diff --git a/content/xbl/src/nsXBLResourceLoader.cpp b/content/xbl/src/nsXBLResourceLoader.cpp
--- a/content/xbl/src/nsXBLResourceLoader.cpp
+++ b/content/xbl/src/nsXBLResourceLoader.cpp
@@ -87,11 +87,6 @@ nsXBLResourceLoader::nsXBLResourceLoader
 {
 }
 
-nsXBLResourceLoader::~nsXBLResourceLoader()
-{
-  delete mResourceList;
-}
-
 void
 nsXBLResourceLoader::LoadResources(PRBool* aResult)
 {
@@ -169,7 +164,6 @@ nsXBLResourceLoader::LoadResources(PRBoo
   mInLoadResourcesFunc = PR_FALSE;
   
   // Destroy our resource list.
-  delete mResourceList;
   mResourceList = nsnull;
 }
 
diff --git a/content/xbl/src/nsXBLResourceLoader.h b/content/xbl/src/nsXBLResourceLoader.h
--- a/content/xbl/src/nsXBLResourceLoader.h
+++ b/content/xbl/src/nsXBLResourceLoader.h
@@ -52,21 +52,18 @@ class nsXBLPrototypeBinding;
 // *********************************************************************/
 // The XBLResourceLoader class
 
-struct nsXBLResource {
-  nsXBLResource* mNext;
-  nsIAtom* mType;
+struct nsXBLResource
+  : public XPCOMGCFinalizedObject
+  , public MMgc::GCFinalizable
+{
+  nsCOMPtr<nsXBLResource> mNext;
+  nsIAtom *const mType;
   nsString mSrc;
 
-  nsXBLResource(nsIAtom* aType, const nsAString& aSrc) {
-    MOZ_COUNT_CTOR(nsXBLResource);
-    mNext = nsnull;
-    mType = aType;
-    mSrc = aSrc;
-  }
-
-  ~nsXBLResource() { 
-    MOZ_COUNT_DTOR(nsXBLResource);  
-    delete mNext; 
+  nsXBLResource(nsIAtom* aType, const nsAString& aSrc) 
+    : mType(aType)
+    , mSrc(aSrc)
+  {
   }
 };
 
@@ -86,7 +83,6 @@ public:
 
   nsXBLResourceLoader(nsXBLPrototypeBinding* aBinding,
                       nsXBLPrototypeResources* aResources);
-  virtual ~nsXBLResourceLoader();
 
   void NotifyBoundElements();