зеркало из https://github.com/mozilla/pjs.git
Fix memory leak
This commit is contained in:
Родитель
75e7829c94
Коммит
9f3d52ca7b
|
@ -50,6 +50,22 @@ nsStreamManager::nsStreamManager()
|
|||
nsStreamManager::~nsStreamManager()
|
||||
{
|
||||
if (mStreamObjects != nsnull) {
|
||||
|
||||
nsIIterator * iterator;
|
||||
|
||||
mStreamObjects->CreateIterator(&iterator);
|
||||
iterator->Init();
|
||||
|
||||
nsStreamObject * item;
|
||||
|
||||
while(!(iterator->IsDone()))
|
||||
{
|
||||
item = (nsStreamObject *) iterator->CurrentItem();
|
||||
NS_RELEASE(item);
|
||||
iterator->Next();
|
||||
}
|
||||
NS_RELEASE(iterator);
|
||||
|
||||
mStreamObjects->RemoveAll();
|
||||
NS_RELEASE(mStreamObjects);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ nsStreamObject::~nsStreamObject()
|
|||
NS_IF_RELEASE(mUrl);
|
||||
NS_IF_RELEASE(mParser);
|
||||
NS_IF_RELEASE(mSink);
|
||||
NS_IF_RELEASE(mDTD);
|
||||
//NS_IF_RELEASE(mDTD);
|
||||
NS_IF_RELEASE(mStreamListener);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче