PDA

View Full Version : program crashes (QtTestRunner)



fmariusd
11th December 2008, 17:07
i have a QtTestRunner from where i run some code, a object, which reads from an xml file
[the object.read(.... )

using the libxml2 library when i run the test a second time it crashes my application....and it

stops at this line :
reader = xmlReaderForFile(filename.c_str(), NULL, 1);

but when i use the object to read from the xml file and i use it from an executable project so not Qt it works fine .... even if i put the read operations in a loop
for(int i=0;i<10;i++) TheObject.read(...) ;

Code from inside the object:

....
xmlTextReaderPtr reader=0;
reader = xmlReaderForFile(filename.c_str(), NULL, 1);
....

fmariusd
15th December 2008, 09:27
in case of multithreading call xmlInitParser() in main before creating your thread and it will work fine

and call xmlCleanupParser() after your tread ends