diff --git a/xpcom/ds/nsArray.cpp b/xpcom/ds/nsArray.cpp index 91cbb21a165..2eeb0054804 100644 --- a/xpcom/ds/nsArray.cpp +++ b/xpcom/ds/nsArray.cpp @@ -54,7 +54,18 @@ nsArray::~nsArray() { Clear(); } - + +NS_IMPL_CYCLE_COLLECTING_ADDREF(nsArray) +NS_IMPL_CYCLE_COLLECTING_RELEASE(nsArray) + +NS_IMPL_CYCLE_COLLECTION_CLASS(nsArray) +NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsArray) + tmp->Clear(); +NS_IMPL_CYCLE_COLLECTION_UNLINK_END +NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsArray) + NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(mArray) +NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END + NS_IMETHODIMP nsArray::GetLength(PRUint32* aLength) { diff --git a/xpcom/ds/nsArray.h b/xpcom/ds/nsArray.h index 7b74dd540b8..7f59888eb70 100644 --- a/xpcom/ds/nsArray.h +++ b/xpcom/ds/nsArray.h @@ -42,6 +42,7 @@ #include "nsIMutableArray.h" #include "nsCOMArray.h" #include "nsCOMPtr.h" +#include "nsCycleCollectionParticipant.h" #define NS_ARRAY_CLASSNAME \ "nsIArray implementation" @@ -63,7 +64,8 @@ public: nsArray(const nsCOMArray_base& aBaseArray) : mArray(aBaseArray) { } - NS_DECL_ISUPPORTS + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_CLASS(nsArray) NS_DECL_NSIARRAY NS_DECL_NSIMUTABLEARRAY diff --git a/xpcom/ds/xpcomds.gqi b/xpcom/ds/xpcomds.gqi index a41d0e9d786..cc07f811904 100644 --- a/xpcom/ds/xpcomds.gqi +++ b/xpcom/ds/xpcomds.gqi @@ -34,7 +34,11 @@ %pseudo-iid nsIByteBuffer e4a6e4b0-93b4-11d1-895b-006008911b81 %pseudo-iid nsIUnicharBuffer 14cf6970-93b5-11d1-895b-006008911b81 -NS_IMPL_ISUPPORTS2(nsArray, nsIArray, nsIMutableArray) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsArray) + NS_INTERFACE_MAP_ENTRY(nsIArray) + NS_INTERFACE_MAP_ENTRY(nsIMutableArray) + NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIMutableArray) +NS_INTERFACE_MAP_END NS_IMPL_ISUPPORTS1(nsSimpleProperty, nsIProperty)