int Parse(const char * infile)
{
parser->parse(infile);
pDoc = parser->getDocument();
//Traversing code here
parser->resetDocumentPool();
return 0;
}
};
ParseWrite Parser;
int main(int argc,char** argv)
{
if(argc < 2)//check atleast 1 file is passed
return 0;
for(int i = 1; i < argc; i++)
{
Parser.Parse(argv[i]);
sleep(10);
somefun();
someotherfun();
}
//some other code blocks
return 0;
}
Note: Invoked sleep() after each file parse to check whether the memory is released,its not.any way to release the memory before the next parse starts?