if (--gRefCnt == 0) { NS_IF_RELEASE(gRDFService); NS_IF_RELEASE(gRDFContainerUtils); NS_IF_RELEASE(gSystemPrincipal); NS_IF_RELEASE(gScriptSecurityManager);
--gRefCnt; if (gRefCnt == 0) { delete kTrueStr; delete kFalseStr;  NS_IF_RELEASE(kNC_Title); NS_IF_RELEASE(kNC_child); NS_IF_RELEASE(kNC_Column); NS_IF_RELEASE(kNC_Folder); NS_IF_RELEASE(kRDF_instanceOf); NS_IF_RELEASE(kXUL_element);  if (gRDFService) { nsServiceManager::ReleaseService(kRDFServiceCID, gRDFService); gRDFService = nsnull; }  if (gRDFContainerUtils) { nsServiceManager::ReleaseService(kRDFContainerUtilsCID, gRDFContainerUtils); gRDFContainerUtils = nsnull; }  if (gXULSortService) { nsServiceManager::ReleaseService(kXULSortServiceCID, gXULSortService); gXULSortService = nsnull; }  NS_RELEASE(gNameSpaceManager); NS_IF_RELEASE(gHTMLElementFactory); NS_IF_RELEASE(gXMLElementFactory);  if (gXULUtils) { nsServiceManager::ReleaseService(kXULContentUtilsCID, gXULUtils); gXULUtils = nsnull; }  nsXULAtoms::Release();
nsXULTemplateBuilder::~nsXULTemplateBuilder(void){    if (--gRefCnt == 0) {        NS_IF_RELEASE(gRDFService);        NS_IF_RELEASE(gRDFContainerUtils);        NS_IF_RELEASE(gSystemPrincipal);        NS_IF_RELEASE(gScriptSecurityManager);    }}