Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.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, 03:56 AM   #3 (permalink)
mpramodjain
Mobile Application Dev.
 
Join Date: Oct 2008
Location: Bangalore, india
Posts: 252
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
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,322
Threads: 39,121
Posts: 171,522
Top Poster: smasher (2,577)
Welcome to our newest member, freney
Powered by vBadvanced CMPS v3.1.0

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