NS_RELEASE(kContainerAtom); NS_RELEASE(kLazyContentAtom); NS_RELEASE(kIsContainerAtom); NS_RELEASE(kIsEmptyAtom); NS_RELEASE(kXULContentsGeneratedAtom); NS_RELEASE(kTemplateContentsGeneratedAtom); NS_RELEASE(kContainerContentsGeneratedAtom);
NS_IF_RELEASE(kContainerAtom); NS_IF_RELEASE(kContainmentAtom); NS_IF_RELEASE(kEmptyAtom); NS_IF_RELEASE(kIdAtom); NS_IF_RELEASE(kIgnoreAtom); NS_IF_RELEASE(kInstanceOfAtom); NS_IF_RELEASE(kIsContainerAtom); NS_IF_RELEASE(kIsEmptyAtom); NS_IF_RELEASE(kMenuAtom); NS_IF_RELEASE(kMenuPopupAtom); NS_IF_RELEASE(kOpenAtom); NS_IF_RELEASE(kParentAtom); NS_IF_RELEASE(kPersistAtom); NS_IF_RELEASE(kPropertyAtom); NS_IF_RELEASE(kResourceAtom); NS_IF_RELEASE(kRuleAtom); NS_IF_RELEASE(kTemplateAtom); NS_IF_RELEASE(kTextNodeAtom); NS_IF_RELEASE(kTreeAtom); NS_IF_RELEASE(kTreeChildrenAtom); NS_IF_RELEASE(kTreeItemAtom); NS_IF_RELEASE(kURIAtom); NS_IF_RELEASE(kValueAtom); NS_IF_RELEASE(kXULContentsGeneratedAtom);
RDFGenericBuilderImpl::~RDFGenericBuilderImpl(void){    NS_IF_RELEASE(mRoot);    if (mDB) {        mDB->RemoveObserver(this);        NS_RELEASE(mDB);    }    // NS_IF_RELEASE(mDocument) not refcounted    --gRefCnt;    if (gRefCnt == 0) {        NS_RELEASE(kContainerAtom);        NS_RELEASE(kLazyContentAtom);        NS_RELEASE(kIsContainerAtom);        NS_RELEASE(kIsEmptyAtom);        NS_RELEASE(kXULContentsGeneratedAtom);        NS_RELEASE(kTemplateContentsGeneratedAtom);        NS_RELEASE(kContainerContentsGeneratedAtom);        NS_RELEASE(kIdAtom);        NS_RELEASE(kPersistAtom);        NS_RELEASE(kOpenAtom);        NS_RELEASE(kEmptyAtom);        NS_RELEASE(kResourceAtom);        NS_RELEASE(kURIAtom);        NS_RELEASE(kContainmentAtom);        NS_RELEASE(kIgnoreAtom);        NS_RELEASE(kRefAtom);        NS_RELEASE(kValueAtom);        NS_RELEASE(kNaturalOrderPosAtom);        NS_RELEASE(kTemplateAtom);        NS_RELEASE(kRuleAtom);        NS_RELEASE(kTextAtom);        NS_RELEASE(kPropertyAtom);        NS_RELEASE(kInstanceOfAtom);        NS_RELEASE(kTreeAtom);        NS_RELEASE(kTreeChildrenAtom);        NS_RELEASE(kTreeItemAtom);        NS_RELEASE(kNC_Title);        NS_RELEASE(kNC_child);        NS_RELEASE(kNC_Column);        NS_RELEASE(kNC_Folder);        NS_RELEASE(kRDF_child);        NS_RELEASE(kRDF_instanceOf);        NS_RELEASE(kXUL_element);	if (mLocalstore)	{		// XXX Currently, need to flush localstore as its being leaked		// and thus never written out to disk otherwise		nsCOMPtr<nsIRDFRemoteDataSource>	remoteLocalStore = do_QueryInterface(mLocalstore);		if (remoteLocalStore)		{			remoteLocalStore->Flush();		}		NS_RELEASE(mLocalstore);		mLocalstore = nsnull;		persistLock = PR_FALSE;	}        nsServiceManager::ReleaseService(kRDFServiceCID, gRDFService);        nsServiceManager::ReleaseService(kRDFContainerUtilsCID, gRDFContainerUtils);        nsServiceManager::ReleaseService(kXULSortServiceCID, XULSortService);        NS_RELEASE(gNameSpaceManager);    }}