I was analyzing my app with leaks, and i observe that some core data entity is leaking, how can a NSManagedObject leak? I thought it was managed by the operating system? Are there known leaks in core data? The line that Leaks says causes the leak is
NSMutableArray *e=[NSMutableArray arrayWithArray:[[user videos] allObjects]];
//the line above ^ is pointed to by leaks as generating a leak
for(VideoEntity * v in e)
{
UploadThread *ut= [[UploadThread alloc] init];
[ut setVideoEntity:v];
[threads addObject:ut];
[ut release];
}
Where user is a managed object which contains VideoEntity as a to-many relationship, and I assign the VideoEntitys to some threads to operate on…Leaks says VideoEntity is leaking.
Does anyone have any input?
UploadThread may be retaining it and never releasing it. Yes, NSManagedObjects can leak. They’re just objects. They are part of the same memory management that the rest of the system uses.