if (gXULUtils) { nsServiceManager::ReleaseService(kXULContentUtilsCID, gXULUtils); gXULUtils = nsnull; }  NS_IF_RELEASE(kCommandUpdaterAtom);
XULContentSinkImpl::~XULContentSinkImpl(){    MOZ_COUNT_DTOR(RDF_XULContentSinkImpl);#ifdef DEBUG_REFS    --gInstanceCount;    fprintf(stdout, "%d - RDF: XULContentSinkImpl\n", gInstanceCount);#endif    NS_IF_RELEASE(mParser); // XXX should've been released by now, unless error.    {        // There shouldn't be any here except in an error condition        PRInt32 i = mNameSpaceStack.Count();        while (0 < i--) {            nsINameSpace* nameSpace = (nsINameSpace*)mNameSpaceStack[i];#ifdef PR_LOGGING            if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {                nsAutoString uri;                nsCOMPtr<nsIAtom> prefixAtom;                nameSpace->GetNameSpaceURI(uri);                nameSpace->GetNameSpacePrefix(*getter_AddRefs(prefixAtom));                nsAutoString prefix;                if (prefixAtom)                    {                        const PRUnichar *unicodeString;                        prefixAtom->GetUnicode(&unicodeString);                        prefix = unicodeString;                    }                else                    {                        prefix = "<default>";                    }                char* prefixStr = prefix.ToNewCString();                char* uriStr = uri.ToNewCString();                PR_LOG(gLog, PR_LOG_ALWAYS,                       ("xul: warning: unclosed namespace '%s' (%s)",                        prefixStr, uriStr));                nsCRT::free(prefixStr);                nsCRT::free(uriStr);            }#endif            NS_RELEASE(nameSpace);        }    }    PR_FREEIF(mText);    // Delete all the elements from our overlay array    {        PRInt32 count = mOverlayArray.Count();        for (PRInt32 i = 0; i < count; i++) {            nsString* element = (nsString*)(mOverlayArray[i]);            delete element;        }    }    if (--gRefCnt == 0) {        if (gRDFService) {            nsServiceManager::ReleaseService(kRDFServiceCID, gRDFService);            gRDFService = nsnull;        }        NS_IF_RELEASE(gHTMLElementFactory);        NS_IF_RELEASE(kDataSourcesAtom);        NS_IF_RELEASE(kIdAtom);        NS_IF_RELEASE(kKeysetAtom);        NS_IF_RELEASE(kOverlayAtom);        NS_IF_RELEASE(kPositionAtom);        NS_IF_RELEASE(kRefAtom);        NS_IF_RELEASE(kScriptAtom);        NS_IF_RELEASE(kTemplateAtom);    }}