Re: ValidateAndReturnError
Re: ValidateAndReturnError
- Subject: Re: ValidateAndReturnError
- From: Eric Slosser <email@hidden>
- Date: Wed, 5 Sep 2007 22:09:58 -0400
I don't know why malloc is unhappy with you, but skip the initial
assignment to furl, that's leaked when you overwrite it on the next
line.
To see where exactly malloc is sending that error message, set a
breakpoint on malloc_printf, then look at the stack when the
breakpoint is hit. That may not tell you WHY you're getting the
error, but it never hurts to know where in the code path it's happening.
And finally, the cocoa or xcode users lists might be a more
appropriate place for this kind of question.
On Aug 2, 2007, at 5:07 PM, Ruddy Opimbat wrote:
Hi! I'm trying to use the ValidateAndReturnError? method for
NSXMLDocument? in order to validate a simple xml, but this method
is giving me some memory leak. Here is my code:
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSXMLDocument *xmlDoc=nil;
NSError *err=nil;
NSURL *furl=[[NSURL alloc]init];
furl = [NSURL fileURLWithPath:@"/Users/mey/Desktop/file.xml"];
xmlDoc = [[NSXMLDocument alloc] initWithContentsOfURL:furl options:
(NSXMLNodePreserveWhitespace|NSXMLNodePreserveCDATA) error:&err];
if([xmlDoc validateAndReturnError:&err]){ // error is here
NSLog(@"Message Valide ");
}else{
NSLog(@"Message invalide");
NSLog(@"Error description: %@",err);
}
[pool release];
return 0;
} I'm having the following error,
*** malloc: vm_allocate(size=8421376) failed (error code=3) ***
malloc[8676]: error: Can't allocate region
I think that the problem is coming from the validateAndReturnError!
Can someone tell me what I am doing wrong here? Thanks.
mey!
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers
Yahoo! Mail
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (Accessibility-
email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden