UNEXPECTED Leak in code block

Discussion in 'iPhone/iPad Programming' started by sujithkrishnan, Feb 24, 2009.

  1. macrumors 6502

    Joined:
    May 9, 2008
    Location:
    Bangalore
    #1
    Hi all,

    i am making use of ABAddressBook in my app.
    The code is like this...
    Code:
    - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
    {
    	if(kABPersonAddressProperty == property)
    	{
    		[B][COLOR="Red"]ABMultiValueRef multiValueRef =ABRecordCopyValue(person,kABPersonAddressProperty);[/COLOR][/B]
    
    
    
    The Instruments showing LEAK for the ABOVE HIGHLIGHTED LINE..
    Similarly the LEAK is shown for where i am fetching the emails (MultiValueRef) from contacts...

    Code:
    [COLOR="red"][B]ABMultiValueRef multiValueEmail = ABRecordCopyValue(person, kABPersonEmailProperty);
    [/B][/COLOR]
    Why ???
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Did you read the documentation?

    I note it says "You are responsible for releasing this object."...
     

Share This Page