Clean up memory leaks.
This commit is contained in:
dougt%netscape.com 2000-07-27 06:14:06 +00:00
Родитель 9bfe3f2e81
Коммит 920f29e288
2 изменённых файлов: 40 добавлений и 0 удалений

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

@ -252,8 +252,28 @@ nsChromeRegistry::nsChromeRegistry()
}
}
static PRBool DatasourceEnumerator(nsHashKey *aKey, void *aData, void* closure)
{
if (!closure || !aData)
return PR_FALSE;
nsIRDFCompositeDataSource* compositeDS = (nsIRDFCompositeDataSource*) closure;
nsCOMPtr<nsISupports> supports = (nsISupports*)aData;
nsCOMPtr<nsIRDFDataSource> dataSource = do_QueryInterface(supports);
if (!dataSource)
return PR_FALSE;
compositeDS->RemoveDataSource(dataSource);
return PR_TRUE;
}
nsChromeRegistry::~nsChromeRegistry()
{
mDataSourceTable->Enumerate(DatasourceEnumerator, mChromeDataSource);
delete mDataSourceTable;
if (mRDFService) {

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

@ -252,8 +252,28 @@ nsChromeRegistry::nsChromeRegistry()
}
}
static PRBool DatasourceEnumerator(nsHashKey *aKey, void *aData, void* closure)
{
if (!closure || !aData)
return PR_FALSE;
nsIRDFCompositeDataSource* compositeDS = (nsIRDFCompositeDataSource*) closure;
nsCOMPtr<nsISupports> supports = (nsISupports*)aData;
nsCOMPtr<nsIRDFDataSource> dataSource = do_QueryInterface(supports);
if (!dataSource)
return PR_FALSE;
compositeDS->RemoveDataSource(dataSource);
return PR_TRUE;
}
nsChromeRegistry::~nsChromeRegistry()
{
mDataSourceTable->Enumerate(DatasourceEnumerator, mChromeDataSource);
delete mDataSourceTable;
if (mRDFService) {