if (nsnull != mAttributes) { PRInt32 count = mAttributes->Count(); PRInt32 index; for (index = 0; index < count; index++) { nsGenericAttribute* attr = (nsGenericAttribute*)mAttributes->ElementAt(index); delete attr; } delete mAttributes; }
delete mAttributes;
RDFElementImpl::~RDFElementImpl(){    if (nsnull != mAttributes) {        PRInt32 count = mAttributes->Count();        PRInt32 index;        for (index = 0; index < count; index++) {            nsGenericAttribute* attr = (nsGenericAttribute*)mAttributes->ElementAt(index);            delete attr;        }        delete mAttributes;    }    //NS_IF_RELEASE(mDocument); // not refcounted    //NS_IF_RELEASE(mParent)    // not refcounted    NS_IF_RELEASE(mTag);    NS_IF_RELEASE(mListenerManager);    NS_IF_RELEASE(mChildren);    // Release our broadcast listeners    PRInt32 count = mBroadcastListeners.Count();    for (PRInt32 i = 0; i < count; i++) {        XULBroadcastListener* xulListener = (XULBroadcastListener*)mBroadcastListeners[0];        RemoveBroadcastListener(xulListener->mAttribute, xulListener->mListener);    }    if (--gRefCnt == 0) {        if (gRDFService) {            nsServiceManager::ReleaseService(kRDFServiceCID, gRDFService);            gRDFService = nsnull;        }        NS_IF_RELEASE(kIdAtom);        NS_IF_RELEASE(kContainerAtom);        NS_IF_RELEASE(gNameSpaceManager);    }}