• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSXMLParser frees itself on error?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSXMLParser frees itself on error?


  • Subject: NSXMLParser frees itself on error?
  • From: Mike Manzano <email@hidden>
  • Date: Thu, 30 Apr 2009 23:59:03 -0700

Hi Folks,

I have an NSXMLParser doing parsing the contents of a URL. It is allocated like this:

	_showsParser = [[NSXMLParser alloc] initWithContentsOfURL:url];

Given a good URL to a parsable XML document, its parserDidEndDocument: method calls this method:

- (void) cleanupShowParsing {
	[_buildingShows removeAllObjects];
	[_showsParser abortParsing];
	[_showsParser release];
	_showsParser = nil;
	_currentlyBuildingShows = NO;
}

Note that the parser is aborted and released in here. This seems to work just fine, multiple times, with no problems. However, if I give it a URL to non-XML data (should be a 404 page somewhere), it calls parser:parseErrorOccurred: as expected. This method also calls - cleanupShowParsing. However, when it is called from here, the program eventually terminates with:

2009-04-30 23:53:52.573 Revision3[49280:20b] PARSE ERROR: Error Domain=NSXMLParserErrorDomain Code=5 "Operation could not be completed. (NSXMLParserErrorDomain error 5.)"
objc[49280]: FREED(id): message shouldContinueAfterFatalError sent to freed object=0xf305a0


I have verified that 0xf305a0 is indeed _showsParser. Further, I've verified that if I don't release _showsParser in -cleanupShowParsing, no error occurs given a non-XML file.

My question is it the case that NSXMLParser frees itself if it encounters an error, but does NOT free itself on a successful parse of a document?

Thanks!

Mike

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSXMLParser frees itself on error?
      • From: Mike Manzano <email@hidden>
    • Re: NSXMLParser frees itself on error?
      • From: Kyle Sluder <email@hidden>
    • Re: NSXMLParser frees itself on error?
      • From: Fritz Anderson <email@hidden>
    • Re: NSXMLParser frees itself on error?
      • From: Jesper Storm Bache <email@hidden>
    • Re: NSXMLParser frees itself on error?
      • From: Keary Suska <email@hidden>
    • Re: NSXMLParser frees itself on error?
      • From: "Stephen J. Butler" <email@hidden>
  • Next by Date: Re: NSXMLParser frees itself on error?
  • Next by thread: Re: NSXMLParser frees itself on error?
  • Index(es):
    • Date
    • Thread