Следующий код создает ряд утечек, которые я не понимаю, когда освобождаю все объекты, созданные с помощью Create или Copy. Я не много работал с объектами CF, поэтому у меня может быть неправильное понимание цикла хранения. Любая помощь будет оценена, пожалуйста:
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);