delete mNameSpaceStack;
XULContentSinkImpl::~XULContentSinkImpl(){    NS_IF_RELEASE(mNameSpaceManager);    NS_IF_RELEASE(mDocumentURL);    NS_IF_RELEASE(mDataSource);    NS_IF_RELEASE(mDocument);    NS_IF_RELEASE(mParser);    NS_IF_RELEASE(mFragmentRoot);    if (mNameSpaceStack) {        // NS_PRECONDITION(0 == mNameSpaceStack->Count(), "namespace stack not empty");        fprintf(stderr, "XULContentSinkImpl destructor: namespace stack not empty\n");        // There shouldn't be any here except in an error condition        PRInt32 index = mNameSpaceStack->Count();        while (0 < index--) {            nsINameSpace* nameSpace = (nsINameSpace*)mNameSpaceStack->ElementAt(index);            NS_RELEASE(nameSpace);        }        delete mNameSpaceStack;    }    if (mContextStack) {        // NS_PRECONDITION(0 == mContextStack->Count(), "content stack not empty");        fprintf(stderr, "XULContentSinkImpl destructor: content stack not empty\n");        // 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 index = mContextStack->Count();        while (0 < index--) {            nsIRDFResource* resource;            XULContentSinkState state;            PopResourceAndState(resource, state);            NS_IF_RELEASE(resource);        }        delete mContextStack;    }    PR_FREEIF(mText);    if (--gRefCnt == 0) {        nsServiceManager::ReleaseService(kRDFServiceCID, gRDFService);        NS_IF_RELEASE(kRDF_child);        NS_IF_RELEASE(kRDF_instanceOf);        NS_IF_RELEASE(kRDF_type);        NS_IF_RELEASE(kXUL_element);    }}