fprintf(stdout, "%d - RDF: RDFContentSinkImpl\n", gInstanceCount);
PRINTF("%d - RDF: RDFContentSinkImpl\n", gInstanceCount);
RDFContentSinkImpl::~RDFContentSinkImpl(){#ifdef DEBUG_REFS    --gInstanceCount;    fprintf(stdout, "%d - RDF: RDFContentSinkImpl\n", gInstanceCount);#endif    NS_IF_RELEASE(mDocumentURL);    if (mNameSpaceStack) {        // There shouldn't be any here except in an error condition        PRInt32 i = mNameSpaceScopes.Count();        while (--i >= 0)            PopNameSpaces();    }    if (mContextStack) {        PR_LOG(gLog, PR_LOG_ALWAYS,               ("rdfxml: warning! unclosed tag"));        // XXX we should never need to do this, but, we'll write the        // code all the same. If someone left the content stack dirty,        // pop all the elements off the stack and release them.        PRInt32 i = mContextStack->Count();        while (0 < i--) {            nsIRDFResource* resource;            RDFContentSinkState state;            PopContext(resource, state);#ifdef PR_LOGGING            // print some fairly useless debugging info            // XXX we should save line numbers on the context stack: this'd            // be about 1000x more helpful.            if (resource) {                nsXPIDLCString uri;                resource->GetValue(getter_Copies(uri));                PR_LOG(gLog, PR_LOG_ALWAYS,                       ("rdfxml:   uri=%s", (const char*) uri));            }#endif            NS_IF_RELEASE(resource);        }        delete mContextStack;    }    PR_FREEIF(mText);    if (--gRefCnt == 0) {        if (gRDFService) {            nsServiceManager::ReleaseService(kRDFServiceCID, gRDFService);            gRDFService = nsnull;        }        if (gRDFContainerUtils) {            nsServiceManager::ReleaseService(kRDFContainerUtilsCID, gRDFContainerUtils);            gRDFContainerUtils = nsnull;        }        NS_IF_RELEASE(kRDF_type);        NS_IF_RELEASE(kRDF_instanceOf);        NS_IF_RELEASE(kRDF_Alt);        NS_IF_RELEASE(kRDF_Bag);        NS_IF_RELEASE(kRDF_Seq);        NS_IF_RELEASE(kRDF_nextVal);        NS_IF_RELEASE(kAboutAtom);        NS_IF_RELEASE(kIdAtom);        NS_IF_RELEASE(kAboutEachAtom);        NS_IF_RELEASE(kResourceAtom);        NS_IF_RELEASE(kRDFAtom);        NS_IF_RELEASE(kDescriptionAtom);        NS_IF_RELEASE(kBagAtom);        NS_IF_RELEASE(kSeqAtom);        NS_IF_RELEASE(kAltAtom);        NS_IF_RELEASE(kLiAtom);        NS_IF_RELEASE(kXMLNSAtom);    }}