Made widget observer observe the composite data source.

This commit is contained in:
waterson%netscape.com 1999-03-09 08:05:26 +00:00
parent 7b02f128df
commit f13802c572
3 changed files with 18 additions and 3 deletions

View File

@ -215,7 +215,10 @@ static const char kRDFNameSpaceURI[]
RDFGenericBuilderImpl::~RDFGenericBuilderImpl(void)
{
NS_IF_RELEASE(mRoot);
NS_IF_RELEASE(mDB);
if (mDB) {
mDB->RemoveObserver(this);
NS_RELEASE(mDB);
}
// NS_IF_RELEASE(mDocument) not refcounted
--gRefCnt;
@ -304,6 +307,8 @@ RDFGenericBuilderImpl::SetDataBase(nsIRDFCompositeDataSource* aDataBase)
mDB = aDataBase;
NS_ADDREF(mDB);
mDB->AddObserver(this);
return NS_OK;
}

View File

@ -215,7 +215,10 @@ static const char kRDFNameSpaceURI[]
RDFGenericBuilderImpl::~RDFGenericBuilderImpl(void)
{
NS_IF_RELEASE(mRoot);
NS_IF_RELEASE(mDB);
if (mDB) {
mDB->RemoveObserver(this);
NS_RELEASE(mDB);
}
// NS_IF_RELEASE(mDocument) not refcounted
--gRefCnt;
@ -304,6 +307,8 @@ RDFGenericBuilderImpl::SetDataBase(nsIRDFCompositeDataSource* aDataBase)
mDB = aDataBase;
NS_ADDREF(mDB);
mDB->AddObserver(this);
return NS_OK;
}

View File

@ -215,7 +215,10 @@ static const char kRDFNameSpaceURI[]
RDFGenericBuilderImpl::~RDFGenericBuilderImpl(void)
{
NS_IF_RELEASE(mRoot);
NS_IF_RELEASE(mDB);
if (mDB) {
mDB->RemoveObserver(this);
NS_RELEASE(mDB);
}
// NS_IF_RELEASE(mDocument) not refcounted
--gRefCnt;
@ -304,6 +307,8 @@ RDFGenericBuilderImpl::SetDataBase(nsIRDFCompositeDataSource* aDataBase)
mDB = aDataBase;
NS_ADDREF(mDB);
mDB->AddObserver(this);
return NS_OK;
}