Hello,
Can anybody tell me, how to release a DOMNodeList*? Or do you happen to see what causes a memory leak in the function below!


Best regards
Pat

Following is the function, which seems to cause an error. My App crashes after using it about 200 times!

void sdeconn::get_sql_stat_from_xml(std::vector<CString>& tag)
{
        DOMNodeList* sql_statements;
        
        //Get vector-size
        int size=tag.size();

        //Allocate XMLCh for tags
        static XMLCh **pOutputEncoding;
        pOutputEncoding= (XMLCh** ) malloc(size * sizeof(XMLCh*));

        //Translate Tags
        for(int i=0; i<size; i++){
                        pOutputEncoding[i] = XMLString::transcode(tag[i]);
        }

//Clear Vector
tag.clear();

//Get SQL-Statement and save in vector
for(i=0; i<size; i++){
sql_statements = get_xml_document()->getElementsByTagName(pOutputEncoding[i]);
tag.push_back(XMLString::transcode(sql_statements->item(0)->getTextContent()));
XMLString::release(&pOutputEncoding[i]);
}


//Release Memory
free(pOutputEncoding);
}



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to