Bug 5637. Don't release each observer in the destructor, because we only hold a weak ref to it. r=putterman,a=chofmann.

This commit is contained in:
waterson%netscape.com 1999-04-29 04:21:12 +00:00
Родитель aa24a3d644
Коммит e325b77546
3 изменённых файлов: 9 добавлений и 21 удалений

Просмотреть файл

@ -93,13 +93,9 @@ nsMessageViewDataSource::~nsMessageViewDataSource (void)
RemoveDataSource(mDataSource);
if(mURI)
PL_strfree(mURI);
if (mObservers) {
for (PRInt32 i = mObservers->Count() - 1; i >= 0; --i) {
nsIRDFObserver* obs = (nsIRDFObserver*) mObservers->ElementAt(i);
NS_RELEASE(obs);
}
delete mObservers;
}
delete mObservers; // we only hold a weak ref to each observer
nsrefcnt refcnt;
NS_RELEASE2(kNC_MessageChild, refcnt);
NS_RELEASE2(kNC_Subject, refcnt);

Просмотреть файл

@ -76,13 +76,9 @@ nsMsgFolderDataSource::~nsMsgFolderDataSource (void)
mRDFService->UnregisterDataSource(this);
PL_strfree(mURI);
if (mObservers) {
for (PRInt32 i = mObservers->Count() - 1; i >= 0; --i) {
nsIRDFObserver* obs = (nsIRDFObserver*) mObservers->ElementAt(i);
NS_RELEASE(obs);
}
delete mObservers;
}
delete mObservers; // we only hold a weak ref to each observer
nsrefcnt refcnt;
NS_RELEASE2(kNC_Child, refcnt);
NS_RELEASE2(kNC_MessageChild, refcnt);

Просмотреть файл

@ -72,13 +72,9 @@ nsMsgMessageDataSource::~nsMsgMessageDataSource (void)
mRDFService->UnregisterDataSource(this);
PL_strfree(mURI);
if (mObservers) {
for (PRInt32 i = mObservers->Count() - 1; i >= 0; --i) {
nsIRDFObserver* obs = (nsIRDFObserver*) mObservers->ElementAt(i);
NS_RELEASE(obs);
}
delete mObservers;
}
delete mObservers; // we only hold a weak ref to each observer
nsrefcnt refcnt;
NS_RELEASE2(kNC_Subject, refcnt);