Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

Thread: Memory leak
View Single Post
Old 08-29-2008, 05:05 PM   #1 (permalink)
martinn
Registered Member
 
Join Date: May 2008
Posts: 133
Default Memory leak

I'm trying to parse an xmlfile almost like the seismicXML sample. What I do is the following:

I have created a object called XMLReader exactly like in the sample from apple. And then to init the object and start parsing:

NSURL *myUrl = [NSURL URLWithString:sendUrl];
XMLReader *streamingParser = [[XMLReader alloc] init];
[streamingParser parseXMLFileAtURL:myUrl parseError:&parseError];
[streamingParser release];
NSLog([NSString stringWithFormat:@"retainCount of myUrl: %i",[myUrl retainCount]]);


In the parseXMLFileAtURL:

NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:URL];
[parser setDelegate:self];
[parser parse];
[parser release];


In instruments I can see I have a memory leak with NSMachPort and CFRunLoopSource (whats this?) both seem to come from the parseXMLFileAtURL. What I can see is also that myUrl have a retainCount of how the same size as how many rows I have parsed from the xml when writing it to the log. 7 in my case, so I think this is maybe what's wrong but I'm not sure how to do this, I can't release myUrl as I'm not init it? And in the parseXMLFileAtURL all I do is passing it onto the initWithContentsOfURL-method, can't see whats wrong here, anyone?

Thanks really much for your help!
martinn is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,836
Threads: 89,209
Posts: 380,642
Top Poster: BrianSlick (7,129)
Welcome to our newest member, abbylowin
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:24 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.