instrument leaks and reliability?

Discussion in 'iOS Programming' started by MACloop, Apr 16, 2010.

  1. MACloop macrumors 6502

    Joined:
    May 18, 2009
    Location:
    Germany
    #1
    Hello,
    I have a navigationController with some tableViews and have noticed that if I use this with only static values, like showing some details when the user clicks on a cell, there are no leaks detected. If I go on and put some calculations like if some vaiable !=nil -> add something to the view, leaks are detected. Also when I add detectTelefoneNumber or link in texts, leaks are detected. As far as I can see I do release everything I have alloced or retained after I have added it to the view. Any ideas?

    for instance:
    This is detected as leaking: (red in the code)
    Code:
    telefonValue = [[UITextView alloc]initWithFrame:CGRectMake(102, 245, 208, 22)];
    if([someObject telefonNummer] != nil) {
    telefonValue.text = [someObject telefonNummer];
    }
    ...
    [COLOR="Red"]telefonValue.dataDetectorTypes = UIDataDetectorTypePhoneNumber;[/COLOR]
    telefonValue.font = [UIFont systemFontOfSize:13.0];
    telefonValue.backgroundColor = [UIColor clearColor];
    telefonValue.textColor = [UIColor darkGrayColor];
    telefonValue.editable = NO;
    [myScrollView addSubview:telefonValue];
    [telefonValue release];
    
    Anyone having any ideas? I assume that I do not understand the hints given by the leaks-program but perhabs someone else has any idea?

    Thanks in advance!
    MACloop
     
  2. MACloop thread starter macrumors 6502

    Joined:
    May 18, 2009
    Location:
    Germany
    #2
    ups

    forgot to add the screen shot from instruments' leaks. here it comes. Any Ideas? How should I understand the messages from the leak-software?
    Thnaks in advance!
    MACloop
     

    Attached Files:

  3. MACloop thread starter macrumors 6502

    Joined:
    May 18, 2009
    Location:
    Germany
    #3
    Hallo again,
    can someone please tell me how and when I should see the reported leaks from Instruments leaks, as serious and as produced by my code? Are, for instance, those leaks my fault (attachments)? I do not get any indications on where in my code, the problem is created? Please help me to clear this...

    QuartzCore mem_alloc seems to grow when I reload a view in my app, what I think is worth to note.

    Foundation -[NSCFArray copyWithZone:] is also growing but not that rapidely...

    Are those leaks produced by me or are they out of my control, ie produced of the frameworks mentioned....?

    Thanks in advance!
    MACloop
     

    Attached Files:

  4. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    The leaks tool can show you the stack trace of the location that the leaked object was created. You need to look at that as a start to figuring out the leak.

    The leaks you show for open_handle_to_dylib_path are probably not real leaks. Can't tell about the others but in general I never see dozens of leaked objects when I run leaks so they probably are real leaks.

    Did you run Build and Analyze?
     
  5. MACloop thread starter macrumors 6502

    Joined:
    May 18, 2009
    Location:
    Germany
    #5
    Hello,
    yes I did run Build and Analyze and that did not really give me any indication. I am pretty sure that it is a real leak now... I think I have to go on seaching... Thanks for your help!
    MACloop
     

Share This Page