NS_RELEASE(kNC_Name); NS_RELEASE(kRDF_instanceOf); NS_RELEASE(kRDF_Seq);  if (collationService) { NS_RELEASE(collationService); collationService = nsnull; } if (gRDFService) { nsServiceManager::ReleaseService(kRDFServiceCID, gRDFService); gRDFService = nsnull; } if (gXULSortService) { nsServiceManager::ReleaseService(kXULSortServiceCID, gXULSortService); gXULSortService = nsnull; }
NS_IF_RELEASE(collationService); collationService = nsnull; nsServiceManager::ReleaseService(kRDFServiceCID, gRDFService); gRDFService = nsnull;
XULSortServiceImpl::~XULSortServiceImpl(void){	--gRefCnt;	if (gRefCnt == 0)	{		NS_RELEASE(kTreeAtom);		NS_RELEASE(kTreeBodyAtom);		NS_RELEASE(kTreeCellAtom);	        NS_RELEASE(kTreeChildrenAtom);	        NS_RELEASE(kTreeColAtom);	        NS_RELEASE(kTreeItemAtom);	        NS_RELEASE(kResourceAtom);	        NS_RELEASE(kNameAtom);	        NS_RELEASE(kSortAtom);	        NS_RELEASE(kSortDirectionAtom);	        NS_RELEASE(kIdAtom);	        NS_RELEASE(kNaturalOrderPosAtom);		NS_RELEASE(kRDF_type);		NS_RELEASE(kURIAtom);	        NS_RELEASE(kNC_Name);	        NS_RELEASE(kRDF_instanceOf);	        NS_RELEASE(kRDF_Seq);		if (collationService)		{			NS_RELEASE(collationService);			collationService = nsnull;		}		if (gRDFService)		{			nsServiceManager::ReleaseService(kRDFServiceCID, gRDFService);			gRDFService = nsnull;		}		if (gXULSortService)		{			nsServiceManager::ReleaseService(kXULSortServiceCID, gXULSortService);			gXULSortService = nsnull;		}	}}