Hello Fred,
Thanks for all of your work on the XML classes, and for your summary
of the areas that still need attention. My original issue #1 (at the
beginning of this thread) is still outstanding as well. My issues #2
and #3 have been resolved -- thanks!
As it happens, I managed to get back to this yesterday, and spent
most of yesterday and today trying to isolate the memory crash I was
seeing. It turns out there were (unfortunately) a lot of red herrings
in my earlier description of the sequence that leads to the crash,
and obviously some missing steps or you would have been able to
reproduce it. I was finally able to reproduce the crash myself and
create a minimal test case for this problem.
Unfortunately, I've now spent too much time on this to do much more
with it. I appreciate that you've spent a lot of time on this code,
too, but I hope you might be able to figure out how to resolve this
problem. If not, we will revert to a slightly earlier version of the
NSXML* code for now, which doesn't crash in this way.
Regards,
Doug
Here is my crashTest:
#import "ObjectTesting.h" #import<Foundation/NSAutoreleasePool.h>
#import<Foundation/NSXMLDocument.h>
#import<Foundation/NSXMLElement.h>
int main() { NSAutoreleasePool *arp = [NSAutoreleasePool new];
NSXMLDocument *node; NSXMLDocument *node2; NSXMLElement *elem;
NSXMLElement *elem2; NSXMLNode *child; NSXMLNode *child2;
NSString *simpleXML = @"<num>6</num>";
// create two documents (containing root elements with the same name
("num") -- may be significant?) node = [[NSXMLDocument alloc]
initWithXMLString:simpleXML options:0 error:NULL]; PASS(node != nil,
"document was initialized from a string");
node2 = [[NSXMLDocument alloc] initWithXMLString:simpleXML options:0
error:NULL]; PASS(node2 != nil, "document 2 was initialized from a
string");
// detach the root elements from their documents elem = [node
rootElement]; // PASS_EQUAL([elem XMLString], simpleXML, "root
element is correct"); [elem detach];
elem2 = [node2 rootElement]; // PASS_EQUAL([elem2 XMLString],
simpleXML, "root element 2 is correct"); [elem2 detach];
// now, simply accessing the text node child of each element leads to
a CRASH child = [elem childAtIndex:0]; child2 = [elem2
childAtIndex:0];
[node release]; [node2 release];
[arp release]; arp = nil;
return 0; }