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 12-20-2008, 04:56 AM   #3 (permalink)
mpramodjain
Mobile Application Dev.
 
Join Date: Oct 2008
Location: Bangalore, india
Posts: 362
Default

Quote:
Originally Posted by martinn View Post
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!
Hi, I am also having the same problem.
If u found the solution, please help me...
Thank u.
mpramodjain is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,722
Threads: 89,183
Posts: 380,508
Top Poster: BrianSlick (7,125)
Welcome to our newest member, idny99
Powered by vBadvanced CMPS v3.1.0

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