The following code is creating a number of leaks which I do not understand as I release all objects created with Create or Copy. I have not worked with CF objects extensively so I may have a misunderstanding of the retention cycle. Any help would be appreciated please:
ABMutableMultiValueRef webServices = ABRecordCopyValue(aRecord, kABPersonInstantMessageProperty);
for (CFIndex i = 0; i < ABMultiValueGetCount(webServices); i++) {
CFDictionaryRef webService = CFDictionaryCreateCopy(NULL, ABMultiValueCopyValueAtIndex(webServices, i));
webServiceLabel = ABMultiValueCopyLabelAtIndex(webServices, i);
webServiceProvider = CFDictionaryGetValue(webService, kABPersonInstantMessageServiceKey);
webServiceUserName = CFDictionaryGetValue(webService, kABPersonInstantMessageUsernameKey);
// Data to be saved at this point
if (webService) CFRelease(webService);
if (webServiceLabel) CFRelease(webServiceLabel);
}
if (webServices) CFRelease(webServices);