Re: [Flightgear-devel] EasyXML.cxx

2005-09-17 Thread Erik Hofman
Jon Berndt wrote: I'm not surprised it breaks with malformed XML files. A suggested fix is below. if (!input.good()) { sg_io_exception ex("Problem reading file", sg_location(path, XML_GetCurrentLineNumber(parser), XML_GetC

RE: [Flightgear-devel] EasyXML.cxx

2005-09-17 Thread Jon Berndt
> I'm not surprised it breaks with malformed XML files. > A suggested fix is below. > > if (!input.good()) { >sg_io_exception ex("Problem reading file", > sg_location(path, > XML_GetCurrentLineNumber(parser), > XML_GetC

Re: [Flightgear-devel] EasyXML.cxx

2005-09-13 Thread Richard Harrison
I'm not surprised it breaks with malformed XML files. A suggested fix is below. if (!input.good()) { sg_io_exception ex("Problem reading file", sg_location(path, XML_GetCurrentLineNumber(parser), XML_GetCurrentColumnNumber

Re: [Flightgear-devel] EasyXML.cxx

2005-09-13 Thread Harald JOHNSEN
Richard Harke wrote: I don't have the original post in front of me but if I remember rightly, just a couple of values from the object are needed for the throw. Why not copy them to local vars, do the XML_ParserFree and then the throw using the local vars? Richard Now that you talk about tha

Re: [Flightgear-devel] EasyXML.cxx

2005-09-13 Thread Richard Harke
I don't have the original post in front of me but if I remember rightly, just a couple of values from the object are needed for the throw. Why not copy them to local vars, do the XML_ParserFree and then the throw using the local vars? Richard On Tue September 13 2005 00:45, Erik Hofman wrote: > R

Re: [Flightgear-devel] EasyXML.cxx

2005-09-13 Thread Erik Hofman
Richard Harrison wrote: Surely the XML_ParserFree should be after the throw? (I appreciate this is 99% safe, but it probably isn't the way that things should be done). The problem is that the program doesn't return to the function after throwing an exception. I assume it's best to add the XML