0
私はInstrumentsを実行しており、オブジェクトタイプ_NSCFData、AXUIElement、Mallocの3つのリークを報告しており、次の機能を指しています。私はCFオブジェクトが管理されていないので、いくつかのブリッジングをやっています。どのように、なぜこの機能が漏れているのかわかりません。NSCFData、AXUIElementメモリリーク
- (NSArray *)subelementsFromElement:(AXUIElementRef)element forAttribute:(NSString *)attribute {
CFArrayRef subElementsCFArrayRef;
NSArray *subElements=nil;
CFIndex count=0;
AXError result;
result=AXUIElementGetAttributeValueCount(element, (__bridge CFStringRef)attribute, &count);
if(result!=kAXErrorSuccess) return nil;
result=AXUIElementCopyAttributeValues(element, (__bridge CFStringRef)attribute, 0, count, &subElementsCFArrayRef);
if(result!=kAXErrorSuccess) return nil;
subElements=(__bridge NSArray*)subElementsCFArrayRef;
return subElements;
}
この方法ですべてを正しく行う場合は、