Thanks a lot. It works, but still crashing…
I mean,
now it doesn’t crash when I call “xmlReaderForFile” the first time,
but when I try to load the alias xml file,
it crashes.. I call the
loading function recursively for all parent
xml files and alias.
It crashes when I load the alias of the
main xml file, while it successfully load the parent and it’s alias..
Please can some one help me.. I am nearing
my deadline..
Regards,
Jayashree
From:
jwert ilstechnology com [mailto:jwert ilstechnology com]
Sent: Wednesday, February 28, 2007
8:22 AM
To: Kali, Jayashree
Cc: xml gnome org;
xml-bounces gnome org
Subject: Re: [xml]
xmlReaderForFile Crashes.. Need immediate help..
Jayashree,
Here
is a link about using libxml2 in threads: http://www.xmlsoft.org/threads.html
I
think if you call xmlInitParser() in main before creating your
thread you will be ok, otherwise your sample looks ok.
Thanks,
Jim
"Kali, Jayashree"
<jayashree kali wachovia com>
Sent
by: xml-bounces gnome org
02/27/2007 02:40 PM
|
To
|
<xml gnome org>
|
cc
|
|
Subject
|
[xml] xmlReaderForFile Crashes.. Need
immediate help..
|
|
Hi,
I am
using the libXML to my xml file. I am using the windows version
of the
libXML, which I downloaded from http://www.zlatkovic.com/libxml.en.html.
When I
use the libXML function “xmlReaderForFile” in a
thread apart from
my
main thread, it crashes. The function is not called concurrently too.
The
below is the code snippet which crashes. Is there anyway I can fix the crash?
Any
help would be greatly appritiated.
Regards,
Jayashree
Code
Snippet
===========
void
loadConfiguration(string urlStr)
{
xmlTextReaderPtr reader = NULL;
// XML_PARSE_NOCDATA,
docs say it merges CDATA into #text.
reader = xmlReaderForFile(urlStr.c_str(), NULL, XML_PARSE_NOENT |
XML_PARSE_NOCDATA);
if
(reader)
{
cout<<"SUCESS..."<<endl<<endl;
}
xmlFreeTextReader(reader);
}
void
loadConfig(void *pData)
{
loadConfiguration("sampleApp.xml");
}
int
_tmain(int argc,
_TCHAR* argv[])
{
loadConfiguration("sampleApp.xml");
_beginthread( loadConfig, 0, NULL );
getch();
return 0;
}
_______________________________________________
xml mailing list, project page
http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml