need to NS_INIT_ISUPPORTS to prevent thresafety assertions. bug 175437,

r=timeless, sr=alecf, a=dbaron


git-svn-id: svn://10.0.0.236/trunk@132422 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu 2002-10-24 01:03:00 +00:00
parent 80b2d8ee10
commit 36a419cd5a
2 changed files with 8 additions and 4 deletions

View File

@ -55,7 +55,7 @@ nsSimpleArrayEnumerator::HasMoreElements(PRBool* aResult)
PRUint32 cnt;
nsresult rv = mValueArray->GetLength(&cnt);
if (NS_FAILED(rv)) return rv;
*aResult = (mIndex < (PRInt32) cnt);
*aResult = (mIndex < cnt);
return NS_OK;
}
@ -74,7 +74,7 @@ nsSimpleArrayEnumerator::GetNext(nsISupports** aResult)
PRUint32 cnt;
nsresult rv = mValueArray->GetLength(&cnt);
if (NS_FAILED(rv)) return rv;
if (mIndex >= (PRInt32) cnt)
if (mIndex >= cnt)
return NS_ERROR_UNEXPECTED;
return mValueArray->QueryElementAt(mIndex++, NS_GET_IID(nsISupports), (void**)aResult);
@ -108,7 +108,9 @@ public:
NS_DECL_NSISIMPLEENUMERATOR
// nsSimpleArrayEnumerator methods
nsCOMArrayEnumerator() : mIndex(0) {}
nsCOMArrayEnumerator() : mIndex(0) {
NS_INIT_ISUPPORTS();
}
virtual ~nsCOMArrayEnumerator(void);
// specialized operator to make sure we make room for mValues

View File

@ -57,7 +57,9 @@ public:
// nsSimpleArrayEnumerator methods
nsSimpleArrayEnumerator(nsIArray* aValueArray) :
mValueArray(aValueArray), mIndex(0) {}
mValueArray(aValueArray), mIndex(0) {
NS_INIT_ISUPPORTS();
}
virtual ~nsSimpleArrayEnumerator(void) {}
protected: