I have leak in my APP

Discussion in 'iOS Programming' started by 01.vipin, Mar 8, 2011.

  1. 01.vipin macrumors newbie

    Joined:
    Feb 22, 2011
    #1
    I have about 30kb of leak in my RSS reader App.Please sugest some tuts or tips for contolling leak.
     
  2. KnightWRX macrumors Pentium

    KnightWRX

    Joined:
    Jan 28, 2009
    Location:
    Quebec, Canada
    #2
    Make sure to release any objects you alloc when you're done using them. Not much else to answer unless you provide details/code.
     
  3. 01.vipin, Mar 8, 2011
    Last edited by a moderator: Mar 9, 2011

    01.vipin thread starter macrumors newbie

    Joined:
    Feb 22, 2011
    #3
    Code:
    NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:url];
    	[parser setDelegate:self];
    	
    	
    	items = [[NSMutableArray alloc] init];
    	
    	
    	[parser parse]; <---------------- LEAK HERE!!!
    	[parser setDelegate:nil];
     
  4. nickculbertson macrumors regular

    nickculbertson

    Joined:
    Nov 19, 2010
    Location:
    Nashville, TN
    #4
    You didn't release anything.

    [parser release];
     
  5. 01.vipin, Mar 8, 2011
    Last edited by a moderator: Mar 9, 2011

    01.vipin thread starter macrumors newbie

    Joined:
    Feb 22, 2011
    #5
    Code:
    NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:url];
    	[parser setDelegate:self];
    	
    	items = [[NSMutableArray alloc] init];
    	
    	[parser parse];
    
    	[parser release];
    	
    	return self;
    

    I used this but still it leaks. Th leak is upto 24 kb
     
  6. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #6
    What is the type of the memory blocks that leak?

    The line of code indicated by the leaks tool is the line where the leaked block is created, not the line where it leaked. The leaks tool doesn't know where the leak occurs.
     

Share This Page