Why GuardMalloc doesn't report memory leak?

Discussion in 'iPhone/iPad Programming' started by mikezang, Aug 21, 2010.

  1. macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
    #1
    Here is my dealloc in my view controller, even if I comment some release, GuardMalloc doesn't report any memory leak, why?
    Code:
    - (void)dealloc {
        [popoverController release];
        [toolbar release];
        
        [detailItem release];
        //[detailDescriptionLabel release];
        [super dealloc];
    }
    
     
  2. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #2
    Because GuardMalloc is not a tool to find memory leaks. It is a tool that (for instance) crashes when you try and read data from a previously freed block of memory rather than simply reading arbitrary data from the memory address. It also can be used to determine if you are writing past the end of an allocated block of memory. It will also help identify double frees etc.

    Use things like the static analyser and Instruments to help find memory leaks.

    Edit: Look here:

    http://developer.apple.com/iphone/l...ks.html#//apple_ref/doc/uid/20001883-CJBJFIDD
     
  3. thread starter macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
    #3
    Thanks for your easier explanation.
     

Share This Page