필자는 특정 누수가 발생하여 바닥을 파고 드는 것처럼 보이지 않습니다. 검색 결과가 항상 일부 Apple 라이브러리에서 종료되기 때문입니다. 이 문제를 다루는 일부 재향 군인의 도움을 주시면 감사하겠습니다.코어 데이터/NSArray가 누출을 초래합니까?
여기 관련 소스 코드 (주석으로 표시된 누설) 나 온도를 해제하려고
- (void)viewDidLoad {
//[super viewDidLoad];
NSManagedObjectContext *context = [(iEatAppDelegate*)[[UIApplication sharedApplication] delegate] managedObjectContext];
addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:creator action:@selector(launchCreatorWindow)];
self.navigationItem.rightBarButtonItem = addButton;
NSFetchRequest *fetReq = [[NSFetchRequest alloc] init];
[fetReq setEntity:[NSEntityDescription entityForName:entityName inManagedObjectContext:context]];
NSError *e = nil;
NSArray *temp = [context executeFetchRequest:fetReq error:&e];
//leaking here according to performance tool
self.tableObjects = [[NSMutableArray alloc] initWithArray:temp];
if (e) {
NSLog(@"%@, %@", e, [e description]);
}
[fetReq release];
}
하지만 난 이미 오토 릴리즈 수단 믿는 EXC_BAD_ACCESS로 추락.
성능 누출 도구가 카테고리라고합니다 : CFArray (store-deque) 이벤트 : Malloc 또한 내 라이브러리에 책임이 있다고 말했습니다.
0 CoreFoundation __CFAllocatorSystemAllocate
1 CoreFoundation CFAllocatorAllocate
2 CoreFoundation _CFAllocatorAllocateGC
3 CoreFoundation _CFArrayReplaceValues
4 CoreFoundation CFArrayReplaceValues
5 CoreFoundation -[__NSPlaceholderArray initWithObjects:count:]
6 CoreFoundation -[NSArray initWithArray:copyItems:]
7 CoreFoundation -[NSArray initWithArray:]
이 사람이 정말 날이 붙어 있고, 어떤 도움을 크게 감사 :이 숫자 8 내 viewDidLoad에 프레임되고, 스택 추적입니다.