Note that there are some explanatory texts on larger screens.

plurals
  1. POxmlReaderForMemory crashes on 2nd time call
    primarykey
    data
    text
    <p>after making google for long time also, i am unable to find reason/solution for crashing of xmlReaderForMemory,still with valid parameters. </p> <p>i have created two parser function using libxml,when i call individually they are working fine.But when i call one after another it is getting crashed on xmlReaderForMemory by giving error s follows:</p> <p>First-chance exception at 0x7c918fea in nayak.exe: 0xC0000005: Access violation writing location 0x00000010. Unhandled exception at 0x7c918fea in nayak.exe: 0xC0000005: Access violation writing location 0x00000010.</p> <p>now i am giving the code of the two functions:</p> <p>FIRST FUNCTION:</p> <pre><code> char* CB_omniParser(char *omnistring){ char *parseResult,; const char *fileName = omnistring; char *temp,*texttemp,*result=0; int i,len=0,error; xmlTextReaderPtr reader; len= strlen(omnistring); if(len==0) return 0; reader = xmlReaderForMemory(fileName,len,"",NULL,0); if(reader){ temp = (char *) GlobalAlloc(GPTR, sizeof(char)*len); parseResult = (char *) GlobalAlloc(GPTR,sizeof(char)*len+1); while(error=xmlTextReaderRead(reader)) { if(error==-1){ return 0; // on failure } switch(xmlTextReaderNodeType(reader)) { case XML_READER_TYPE_ELEMENT: temp = (char *)xmlTextReaderConstName(reader); strcat(parseResult,temp); strcat(parseResult,"#"); xmlTextReaderMoveToElement(reader); continue; case XML_READER_TYPE_TEXT: temp = (char *)xmlTextReaderConstValue(reader); strcat(parseResult,temp); strcat(parseResult,"|"); continue; } } xmlFreeTextReader(reader); xmlCleanupParser(); return parseResult;//on success returns the parsed omni string } else return 0; // on failure } </code></pre> <p>Second Function:</p> <pre><code> char* CB_xmlParserFromMemory(char *xmlstring){ char *xmlParseresult; char *temp; int i,len,,error;; xmlTextReaderPtr reader1; len= strlen(xmlstring); if(len==0) return 0; reader1 = xmlReaderForMemory(xmlstring,len,NULL,NULL,0); if(reader1){ temp = (char *) GlobalAlloc(GPTR, sizeof(char)*len); while(error=xmlTextReaderRead(reader1)) { if(error==-1){ return 0; // on failure } switch(xmlTextReaderNodeType(reader1)) { case XML_READER_TYPE_ELEMENT: temp = (char *)xmlTextReaderConstName(reader1); strcat(xmlParseresult,"\""); strcat(xmlParseresult,temp); strcat(xmlParseresult,"\""); strcat(xmlParseresult,":"); xmlTextReaderMoveToElement(reader1); continue; case XML_READER_TYPE_TEXT: temp = (char *)xmlTextReaderConstValue(reader1); strcat(xmlParseresult,"\""); strcat(xmlParseresult,temp); strcat(xmlParseresult,"\""); strcat(xmlParseresult,","); continue; } } xmlCleanupParser(); xmlFreeTextReader(reader1); GlobalFree(temp); return xmlParseresult;//on success returns the parsed omni string } else return 0; // on failure } </code></pre> <p>both the functions are working individually fine.but if i call one function after another then both crashes at above given place...ith same error..plz help me.....</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload