From be7d4d271c0fb18872acb5533464f79d53e7d8d6 Mon Sep 17 00:00:00 2001 From: "rjesup%wgate.com" Date: Thu, 6 Sep 2001 19:16:03 +0000 Subject: [PATCH] Bug 92575: voidarray->autovoidarray changes in content/*, minus mChildren changes in nsXULContentSink.cpp and nsGenericElement.cpp as per jst. r=hyatt r=pierre sr=jst --- content/base/src/nsContentIterator.cpp | 9 +++++---- content/base/src/nsContentList.h | 2 +- content/base/src/nsDocument.h | 4 ++-- content/base/src/nsDocumentEncoder.cpp | 10 +++++----- content/base/src/nsGenericDOMDataNode.cpp | 2 +- content/base/src/nsGenericElement.cpp | 5 +++-- content/base/src/nsRange.cpp | 16 ++++++++-------- content/events/src/nsEventListenerManager.cpp | 11 ++++++----- content/html/content/src/nsHTMLFormElement.cpp | 2 +- content/html/content/src/nsHTMLLinkElement.cpp | 2 +- content/html/document/src/nsHTMLContentSink.cpp | 2 +- content/html/style/src/nsCSSLoader.cpp | 13 +++++++------ content/html/style/src/nsCSSStyleSheet.cpp | 6 +++--- content/xbl/src/nsXBLService.cpp | 2 +- content/xml/document/src/nsXMLContentSink.cpp | 2 +- content/xml/document/src/nsXMLContentSink.h | 4 ++-- content/xul/document/src/nsXULContentSink.cpp | 3 ++- content/xul/document/src/nsXULDocument.h | 11 ++++++++--- layout/style/nsCSSLoader.cpp | 13 +++++++------ layout/style/nsCSSStyleSheet.cpp | 6 +++--- 20 files changed, 68 insertions(+), 57 deletions(-) diff --git a/content/base/src/nsContentIterator.cpp b/content/base/src/nsContentIterator.cpp index eac253e49d0..5baed8dcb93 100644 --- a/content/base/src/nsContentIterator.cpp +++ b/content/base/src/nsContentIterator.cpp @@ -786,10 +786,11 @@ protected: nsContentSubtreeIterator& operator=(const nsContentSubtreeIterator&); nsCOMPtr mRange; - nsVoidArray mStartNodes; - nsVoidArray mStartOffsets; - nsVoidArray mEndNodes; - nsVoidArray mEndOffsets; + // these arrays all typically are used and have elements + nsAutoVoidArray mStartNodes; + nsAutoVoidArray mStartOffsets; + nsAutoVoidArray mEndNodes; + nsAutoVoidArray mEndOffsets; }; nsresult NS_NewContentSubtreeIterator(nsIContentIterator** aInstancePtrResult); diff --git a/content/base/src/nsContentList.h b/content/base/src/nsContentList.h index a8b32420ba5..a8bb1abcd51 100644 --- a/content/base/src/nsContentList.h +++ b/content/base/src/nsContentList.h @@ -54,7 +54,7 @@ public: NS_IMETHOD Reset(); protected: - nsVoidArray mElements; + nsAutoVoidArray mElements; }; diff --git a/content/base/src/nsDocument.h b/content/base/src/nsDocument.h index c8774b150de..f0ba5b3ca73 100644 --- a/content/base/src/nsDocument.h +++ b/content/base/src/nsDocument.h @@ -546,8 +546,8 @@ protected: nsCOMPtr mChildren; // contains owning references nsIContent* mRootContent; // a weak reference to the only element in // mChildren, or null if no such element exists. - nsVoidArray mStyleSheets; - nsVoidArray mObservers; + nsAutoVoidArray mStyleSheets; + nsAutoVoidArray mObservers; // basically always has at least 1 entry nsCOMPtr mScriptGlobalObject; nsIEventListenerManager* mListenerManager; PRBool mInDestructor; diff --git a/content/base/src/nsDocumentEncoder.cpp b/content/base/src/nsDocumentEncoder.cpp index 47c9828fd91..587b9a4e050 100644 --- a/content/base/src/nsDocumentEncoder.cpp +++ b/content/base/src/nsDocumentEncoder.cpp @@ -142,11 +142,11 @@ protected: PRInt32 mStartRootIndex; PRInt32 mEndRootIndex; PRBool mHaltRangeHint; - nsVoidArray mCommonAncestors; - nsVoidArray mStartNodes; - nsVoidArray mStartOffsets; - nsVoidArray mEndNodes; - nsVoidArray mEndOffsets; + nsAutoVoidArray mCommonAncestors; + nsAutoVoidArray mStartNodes; + nsAutoVoidArray mStartOffsets; + nsAutoVoidArray mEndNodes; + nsAutoVoidArray mEndOffsets; }; #ifdef XP_MAC diff --git a/content/base/src/nsGenericDOMDataNode.cpp b/content/base/src/nsGenericDOMDataNode.cpp index 6cb17d76a13..c12189401b3 100644 --- a/content/base/src/nsGenericDOMDataNode.cpp +++ b/content/base/src/nsGenericDOMDataNode.cpp @@ -702,7 +702,7 @@ nsGenericDOMDataNode::RangeAdd(nsIDOMRange& aRange) { // lazy allocation of range list if (nsnull == mRangeList) { - mRangeList = new nsVoidArray(); + mRangeList = new nsAutoVoidArray(); } if (nsnull == mRangeList) { return NS_ERROR_OUT_OF_MEMORY; diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index 9b6d86652c9..c055a9e7f69 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -349,6 +349,7 @@ nsCheapVoidArray::SwitchToVector() { void* child = GetSingleChild(); + // XXX Probably should be nsAutoVoidArray to avoid extra alloc - check bloat! mChildren = (void*)new nsVoidArray(); nsVoidArray* vector = GetChildVector(); if (vector && child) { @@ -1896,7 +1897,7 @@ nsGenericElement::RangeAdd(nsIDOMRange& aRange) // lazy allocation of range list if (!mDOMSlots->mRangeList) { - mDOMSlots->mRangeList = new nsVoidArray(); + mDOMSlots->mRangeList = new nsAutoVoidArray(); } if (!mDOMSlots->mRangeList) { return NS_ERROR_OUT_OF_MEMORY; @@ -3006,7 +3007,7 @@ nsGenericContainerElement::SetAttr(nsINodeInfo* aNodeInfo, nsresult rv = NS_ERROR_OUT_OF_MEMORY; if (!mAttributes) { - mAttributes = new nsVoidArray(); + mAttributes = new nsAutoVoidArray(); NS_ENSURE_TRUE(mAttributes, NS_ERROR_OUT_OF_MEMORY); } diff --git a/content/base/src/nsRange.cpp b/content/base/src/nsRange.cpp index dbfcfc82c81..5d8ea8f8ec6 100644 --- a/content/base/src/nsRange.cpp +++ b/content/base/src/nsRange.cpp @@ -735,13 +735,13 @@ PRBool nsRange::IsIncreasing(nsIDOMNode* aStartN, PRInt32 aStartOffset, // lazy allocation of static arrays if (!mStartAncestors) { - mStartAncestors = new nsVoidArray(); + mStartAncestors = new nsAutoVoidArray(); if (!mStartAncestors) return NS_ERROR_OUT_OF_MEMORY; - mStartAncestorOffsets = new nsVoidArray(); + mStartAncestorOffsets = new nsAutoVoidArray(); if (!mStartAncestorOffsets) return NS_ERROR_OUT_OF_MEMORY; - mEndAncestors = new nsVoidArray(); + mEndAncestors = new nsAutoVoidArray(); if (!mEndAncestors) return NS_ERROR_OUT_OF_MEMORY; - mEndAncestorOffsets = new nsVoidArray(); + mEndAncestorOffsets = new nsAutoVoidArray(); if (!mEndAncestorOffsets) return NS_ERROR_OUT_OF_MEMORY; } @@ -906,8 +906,8 @@ nsCOMPtr nsRange::CommonParent(nsIDOMNode* aNode1, nsIDOMNode* aNode // otherwise traverse the tree for the common ancestor // For now, a pretty dumb hack on computing this - nsVoidArray array1; - nsVoidArray array2; + nsAutoVoidArray array1; + nsAutoVoidArray array2; PRInt32 i=0, j=0; // get ancestors of each node @@ -1404,7 +1404,7 @@ nsresult nsRange::DeleteContents() */ // get start node ancestors - nsVoidArray startAncestorList; + nsAutoVoidArray startAncestorList; FillArrayWithAncestors(&startAncestorList,mStartParent); @@ -1419,7 +1419,7 @@ nsresult nsRange::DeleteContents() // and then releasing them when we take them off nsAutoRangeLock lock; - nsVoidArray deleteList; + nsAutoVoidArray deleteList; nsCOMPtr cN; nsCOMPtr cParent; PRInt32 indx; diff --git a/content/events/src/nsEventListenerManager.cpp b/content/events/src/nsEventListenerManager.cpp index 4c3471accb2..ac7d1b89c5a 100644 --- a/content/events/src/nsEventListenerManager.cpp +++ b/content/events/src/nsEventListenerManager.cpp @@ -215,7 +215,7 @@ nsVoidArray* nsEventListenerManager::GetListenersByType(EventArrayType aType, } NS_ASSERTION(!(mGenericListeners->Get(aKey)), "Found existing generic listeners, should be none"); nsVoidArray* listeners; - listeners = new nsVoidArray(); + listeners = new nsAutoVoidArray(); if (!listeners) { //out of memory return nsnull; @@ -229,7 +229,7 @@ nsVoidArray* nsEventListenerManager::GetListenersByType(EventArrayType aType, //Change single type into multi, then add new listener with the code for the //multi type below NS_ASSERTION(!mMultiListeners, "Found existing multi listener array, should be none"); - mMultiListeners = new nsVoidArray(EVENT_ARRAY_TYPE_LENGTH); + mMultiListeners = new nsAutoVoidArray(); if (!mMultiListeners) { //out of memory return nsnull; @@ -241,6 +241,7 @@ nsVoidArray* nsEventListenerManager::GetListenersByType(EventArrayType aType, mManagerType &= ~NS_ELM_SINGLE; mManagerType |= NS_ELM_MULTI; + // we'll fall through into the multi case } if (mManagerType & NS_ELM_MULTI) { @@ -248,7 +249,7 @@ nsVoidArray* nsEventListenerManager::GetListenersByType(EventArrayType aType, if (index >= 0) { nsVoidArray* listeners; NS_ASSERTION(!mMultiListeners->ElementAt(index), "Found existing listeners, should be none"); - listeners = new nsVoidArray(); + listeners = new nsAutoVoidArray(); if (!listeners) { //out of memory return nsnull; @@ -261,7 +262,7 @@ nsVoidArray* nsEventListenerManager::GetListenersByType(EventArrayType aType, //We had no pre-existing type. This is our first non-hash listener. //Create the single listener type NS_ASSERTION(!mSingleListener, "Found existing single listener array, should be none"); - mSingleListener = new nsVoidArray(); + mSingleListener = new nsAutoVoidArray(); if (!mSingleListener) { //out of memory return nsnull; @@ -430,7 +431,7 @@ nsEventListenerManager::AddEventListener(nsIDOMEventListener *aListener, ls->mSubType = aSubType; ls->mSubTypeCapture = NS_EVENT_BITS_NONE; ls->mHandlerIsString = 0; - listeners->InsertElementAt((void*)ls, listeners->Count()); + listeners->AppendElement((void*)ls); NS_ADDREF(aListener); } diff --git a/content/html/content/src/nsHTMLFormElement.cpp b/content/html/content/src/nsHTMLFormElement.cpp index 4e524fa31ac..9b68e2f9fdd 100644 --- a/content/html/content/src/nsHTMLFormElement.cpp +++ b/content/html/content/src/nsHTMLFormElement.cpp @@ -150,7 +150,7 @@ public: nsIDOMHTMLFormElement* mForm; // WEAK - the form owns me - nsVoidArray mElements; // Holds WEAK references - bug 36639 + nsAutoVoidArray mElements; // Holds WEAK references - bug 36639 // This hash holds on to all form controls that are not named form // control (see IsNamedFormControl()), this is needed to properly diff --git a/content/html/content/src/nsHTMLLinkElement.cpp b/content/html/content/src/nsHTMLLinkElement.cpp index e3a3547c639..0cbc9d7fe87 100644 --- a/content/html/content/src/nsHTMLLinkElement.cpp +++ b/content/html/content/src/nsHTMLLinkElement.cpp @@ -376,7 +376,7 @@ nsHTMLLinkElement::GetStyleSheetInfo(nsAWritableString& aUrl, GetAttribute(NS_LITERAL_STRING("rel"), rel); rel.CompressWhitespace(); - nsStringArray linkTypes; + nsStringArray linkTypes(4); nsStyleLinkElement::ParseLinkTypes(rel, linkTypes); // is it a stylesheet link? if (linkTypes.IndexOf(NS_LITERAL_STRING("stylesheet")) < 0) diff --git a/content/html/document/src/nsHTMLContentSink.cpp b/content/html/document/src/nsHTMLContentSink.cpp index 4d0a542aa81..de9e190ec8d 100644 --- a/content/html/document/src/nsHTMLContentSink.cpp +++ b/content/html/document/src/nsHTMLContentSink.cpp @@ -375,7 +375,7 @@ public: nsIDOMHTMLFormElement* mCurrentForm; nsIHTMLContent* mCurrentMap; - nsVoidArray mContextStack; + nsAutoVoidArray mContextStack; SinkContext* mCurrentContext; SinkContext* mHeadContext; PRInt32 mNumOpenIFRAMES; diff --git a/content/html/style/src/nsCSSLoader.cpp b/content/html/style/src/nsCSSLoader.cpp index 575a29f4d33..f849f504814 100644 --- a/content/html/style/src/nsCSSLoader.cpp +++ b/content/html/style/src/nsCSSLoader.cpp @@ -302,7 +302,8 @@ public: nsHashtable mLoadedSheets; // url to first sheet fully loaded for URL nsHashtable mLoadingSheets; // all current loads - nsVoidArray mParsingData; // array of data for sheets currently parsing + // mParsingData is (almost?) always needed, so create with storage + nsAutoVoidArray mParsingData; // array of data for sheets currently parsing nsVoidArray mPendingDocSheets; // loaded sheet waiting for doc insertion nsVoidArray mPendingAlternateSheets; // alternates waiting for load to start @@ -481,7 +482,7 @@ static PRBool PR_CALLBACK DeleteLoadData(void* aData, void* aClosure) static PRBool PR_CALLBACK DeleteSheetMap(nsHashKey* aKey, void* aData, void* aClosure) { - nsVoidArray* map = (nsVoidArray*)aData; + nsAutoVoidArray* map = (nsAutoVoidArray*)aData; delete map; return PR_TRUE; } @@ -1101,9 +1102,9 @@ CSSLoaderImpl::InsertSheetInDoc(nsICSSStyleSheet* aSheet, PRInt32 aDocIndex, aSheet->SetEnabled(! IsAlternate(title)); nsVoidKey key(mDocument); - nsVoidArray* sheetMap = (nsVoidArray*)mSheetMapTable.Get(&key); + nsAutoVoidArray* sheetMap = (nsAutoVoidArray*)mSheetMapTable.Get(&key); if (! sheetMap) { - sheetMap = new nsVoidArray(); + sheetMap = new nsAutoVoidArray(); if (sheetMap) { mSheetMapTable.Put(&key, sheetMap); } @@ -1142,9 +1143,9 @@ CSSLoaderImpl::InsertChildSheet(nsICSSStyleSheet* aSheet, nsICSSStyleSheet* aPar } nsVoidKey key(aParentSheet); - nsVoidArray* sheetMap = (nsVoidArray*)mSheetMapTable.Get(&key); + nsAutoVoidArray* sheetMap = (nsAutoVoidArray*)mSheetMapTable.Get(&key); if (! sheetMap) { - sheetMap = new nsVoidArray(); + sheetMap = new nsAutoVoidArray(); if (sheetMap) { mSheetMapTable.Put(&key, sheetMap); } diff --git a/content/html/style/src/nsCSSStyleSheet.cpp b/content/html/style/src/nsCSSStyleSheet.cpp index 44bbdd00ace..144ae666602 100644 --- a/content/html/style/src/nsCSSStyleSheet.cpp +++ b/content/html/style/src/nsCSSStyleSheet.cpp @@ -675,7 +675,7 @@ public: virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); - nsVoidArray mSheets; + nsAutoVoidArray mSheets; nsIURI* mURL; @@ -814,7 +814,7 @@ protected: CSSStyleSheetInner* mInner; - nsVoidArray* mRuleProcessors; + nsAutoVoidArray* mRuleProcessors; friend class CSSRuleProcessor; friend class DOMMediaListImpl; @@ -1778,7 +1778,7 @@ CSSStyleSheetImpl::GetStyleRuleProcessor(nsIStyleRuleProcessor*& aProcessor, if (NS_SUCCEEDED(result) && cssProcessor) { cssProcessor->AppendStyleSheet(this); if (! mRuleProcessors) { - mRuleProcessors = new nsVoidArray(); + mRuleProcessors = new nsAutoVoidArray(); } if (mRuleProcessors) { NS_ASSERTION(-1 == mRuleProcessors->IndexOf(cssProcessor), "processor already registered"); diff --git a/content/xbl/src/nsXBLService.cpp b/content/xbl/src/nsXBLService.cpp index 1c2c7513c3f..26d608503a9 100644 --- a/content/xbl/src/nsXBLService.cpp +++ b/content/xbl/src/nsXBLService.cpp @@ -222,7 +222,7 @@ private: nsXBLService* mXBLService; // [WEAK] nsCOMPtr mInner; - nsVoidArray mBindingRequests; + nsAutoVoidArray mBindingRequests; nsCOMPtr mDocument; nsCOMPtr mBindingDocument; diff --git a/content/xml/document/src/nsXMLContentSink.cpp b/content/xml/document/src/nsXMLContentSink.cpp index 99f19bdcd85..3068bec27ec 100644 --- a/content/xml/document/src/nsXMLContentSink.cpp +++ b/content/xml/document/src/nsXMLContentSink.cpp @@ -600,7 +600,7 @@ nsXMLContentSink::PushNameSpacesFrom(const nsIParserNode& aNode) } } if (nsnull == mNameSpaceStack) { - mNameSpaceStack = new nsVoidArray(); + mNameSpaceStack = new nsAutoVoidArray(); } mNameSpaceStack->AppendElement(nameSpace); } diff --git a/content/xml/document/src/nsXMLContentSink.h b/content/xml/document/src/nsXMLContentSink.h index a09fc5a8506..20c3ac786f1 100644 --- a/content/xml/document/src/nsXMLContentSink.h +++ b/content/xml/document/src/nsXMLContentSink.h @@ -46,7 +46,7 @@ class nsIDocument; class nsIURI; class nsIWebShell; class nsIContent; -class nsVoidArray; +class nsAutoVoidArray; class nsIXMLDocument; class nsIUnicharInputStream; class nsIParser; @@ -180,7 +180,7 @@ protected: XMLContentSinkState mState; nsCOMPtr mContentStack; - nsVoidArray* mNameSpaceStack; + nsAutoVoidArray* mNameSpaceStack; PRUnichar* mText; PRInt32 mTextLength; diff --git a/content/xul/document/src/nsXULContentSink.cpp b/content/xul/document/src/nsXULContentSink.cpp index 83270578dc8..59629076a06 100644 --- a/content/xul/document/src/nsXULContentSink.cpp +++ b/content/xul/document/src/nsXULContentSink.cpp @@ -176,7 +176,7 @@ protected: void PopNameSpaces(void); nsresult GetTopNameSpace(nsCOMPtr* aNameSpace); - nsVoidArray mNameSpaceStack; + nsAutoVoidArray mNameSpaceStack; nsCOMPtr mNodeInfoManager; @@ -214,6 +214,7 @@ protected: protected: struct Entry { nsXULPrototypeNode* mNode; + // a LOT of nodes have children, but leave for now nsVoidArray mChildren; State mState; Entry* mNext; diff --git a/content/xul/document/src/nsXULDocument.h b/content/xul/document/src/nsXULDocument.h index a8993bca823..0d6a80d2aed 100644 --- a/content/xul/document/src/nsXULDocument.h +++ b/content/xul/document/src/nsXULDocument.h @@ -523,7 +523,8 @@ protected: // NOTE, THIS IS STILL IN PROGRESS, TALK TO PINK OR SCC BEFORE CHANGING nsCOMPtr mArena; - nsVoidArray mObservers; + // This always has at least one observer + nsAutoVoidArray mObservers; nsString mDocumentTitle; nsCOMPtr mDocumentURL; // [OWNER] ??? compare with loader nsCOMPtr mDocumentBaseURL; @@ -535,11 +536,15 @@ protected: nsIScriptGlobalObject* mScriptGlobalObject; // [WEAK] nsXULDocument* mNextSrcLoadWaiter; // [OWNER] but not COMPtr nsString mCharSetID; - nsVoidArray mCharSetObservers; + // This is set in nsPresContext::Init, which calls SetShell. + // Since I think this is almost always done, take the 32-byte hit for + // an nsAutoVoidArray instead of having it be a separate allocation. + nsAutoVoidArray mCharSetObservers; nsVoidArray mStyleSheets; nsCOMPtr mSelection; // [OWNER] PRInt8 mDisplaySelection; - nsVoidArray mPresShells; + // if we're attached to a DocumentViewImpl, we have a presshell + nsAutoVoidArray mPresShells; nsCOMPtr mListenerManager; // [OWNER] nsCOMPtr mNameSpaceManager; // [OWNER] nsCOMPtr mAttrStyleSheet; // [OWNER] diff --git a/layout/style/nsCSSLoader.cpp b/layout/style/nsCSSLoader.cpp index 575a29f4d33..f849f504814 100644 --- a/layout/style/nsCSSLoader.cpp +++ b/layout/style/nsCSSLoader.cpp @@ -302,7 +302,8 @@ public: nsHashtable mLoadedSheets; // url to first sheet fully loaded for URL nsHashtable mLoadingSheets; // all current loads - nsVoidArray mParsingData; // array of data for sheets currently parsing + // mParsingData is (almost?) always needed, so create with storage + nsAutoVoidArray mParsingData; // array of data for sheets currently parsing nsVoidArray mPendingDocSheets; // loaded sheet waiting for doc insertion nsVoidArray mPendingAlternateSheets; // alternates waiting for load to start @@ -481,7 +482,7 @@ static PRBool PR_CALLBACK DeleteLoadData(void* aData, void* aClosure) static PRBool PR_CALLBACK DeleteSheetMap(nsHashKey* aKey, void* aData, void* aClosure) { - nsVoidArray* map = (nsVoidArray*)aData; + nsAutoVoidArray* map = (nsAutoVoidArray*)aData; delete map; return PR_TRUE; } @@ -1101,9 +1102,9 @@ CSSLoaderImpl::InsertSheetInDoc(nsICSSStyleSheet* aSheet, PRInt32 aDocIndex, aSheet->SetEnabled(! IsAlternate(title)); nsVoidKey key(mDocument); - nsVoidArray* sheetMap = (nsVoidArray*)mSheetMapTable.Get(&key); + nsAutoVoidArray* sheetMap = (nsAutoVoidArray*)mSheetMapTable.Get(&key); if (! sheetMap) { - sheetMap = new nsVoidArray(); + sheetMap = new nsAutoVoidArray(); if (sheetMap) { mSheetMapTable.Put(&key, sheetMap); } @@ -1142,9 +1143,9 @@ CSSLoaderImpl::InsertChildSheet(nsICSSStyleSheet* aSheet, nsICSSStyleSheet* aPar } nsVoidKey key(aParentSheet); - nsVoidArray* sheetMap = (nsVoidArray*)mSheetMapTable.Get(&key); + nsAutoVoidArray* sheetMap = (nsAutoVoidArray*)mSheetMapTable.Get(&key); if (! sheetMap) { - sheetMap = new nsVoidArray(); + sheetMap = new nsAutoVoidArray(); if (sheetMap) { mSheetMapTable.Put(&key, sheetMap); } diff --git a/layout/style/nsCSSStyleSheet.cpp b/layout/style/nsCSSStyleSheet.cpp index 44bbdd00ace..144ae666602 100644 --- a/layout/style/nsCSSStyleSheet.cpp +++ b/layout/style/nsCSSStyleSheet.cpp @@ -675,7 +675,7 @@ public: virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); - nsVoidArray mSheets; + nsAutoVoidArray mSheets; nsIURI* mURL; @@ -814,7 +814,7 @@ protected: CSSStyleSheetInner* mInner; - nsVoidArray* mRuleProcessors; + nsAutoVoidArray* mRuleProcessors; friend class CSSRuleProcessor; friend class DOMMediaListImpl; @@ -1778,7 +1778,7 @@ CSSStyleSheetImpl::GetStyleRuleProcessor(nsIStyleRuleProcessor*& aProcessor, if (NS_SUCCEEDED(result) && cssProcessor) { cssProcessor->AppendStyleSheet(this); if (! mRuleProcessors) { - mRuleProcessors = new nsVoidArray(); + mRuleProcessors = new nsAutoVoidArray(); } if (mRuleProcessors) { NS_ASSERTION(-1 == mRuleProcessors->IndexOf(cssProcessor), "processor already registered");