View Full Version : UNEXPECTED Leak in code block

Feb 24, 2009, 08:15 AM
Hi all,

i am making use of ABAddressBook in my app.
The code is like this...

- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
if(kABPersonAddressProperty == property)
ABMultiValueRef multiValueRef =ABRecordCopyValue(person,kABPersonAddressProperty);

The Instruments showing LEAK for the ABOVE HIGHLIGHTED LINE..
Similarly the LEAK is shown for where i am fetching the emails (MultiValueRef) from contacts...

ABMultiValueRef multiValueEmail = ABRecordCopyValue(person, kABPersonEmailProperty);

Why ???

Feb 24, 2009, 08:41 AM
Did you read the documentation (http://developer.apple.com/DOCUMENTATION/UserExperience/Reference/AddressBook/C/ABRecordRef/Reference/reference.html)?

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