Make the nsCOMArray destructor release all the objects. Bug 178813,
r=bbaetz, sr=rpotts git-svn-id: svn://10.0.0.236/trunk@133295 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
2ca1fd4009
commit
9d0e916e54
@ -52,6 +52,15 @@ nsCOMArray_base::nsCOMArray_base(const nsCOMArray_base& aOther)
|
||||
AppendObjects(aOther);
|
||||
}
|
||||
|
||||
nsCOMArray_base::~nsCOMArray_base()
|
||||
{
|
||||
PRInt32 count = Count(), i;
|
||||
for (i = 0; i < count; ++i) {
|
||||
nsISupports* obj = ObjectAt(i);
|
||||
NS_IF_RELEASE(obj);
|
||||
}
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsCOMArray_base::InsertObjectAt(nsISupports* aObject, PRInt32 aIndex) {
|
||||
PRBool result = mArray.InsertElementAt(aObject, aIndex);
|
||||
|
||||
@ -53,6 +53,7 @@ protected:
|
||||
nsCOMArray_base() {}
|
||||
nsCOMArray_base(PRInt32 aCount) : mArray(aCount) {}
|
||||
nsCOMArray_base(const nsCOMArray_base& other);
|
||||
~nsCOMArray_base();
|
||||
|
||||
PRInt32 IndexOf(nsISupports* aObject) const {
|
||||
return mArray.IndexOf(aObject);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user