NSCFString Memory Leak caused by HasMany Relationship
Reported by Udit Sajjanhar | October 12th, 2011 @ 11:01 AM
Model Bundle
bundle.h
@interface Bundle : ARBase
@property(readwrite, assign) NSString *name, *ordering, *id;
@end
@interface Bundle (Accessors)
-(NSArray *) sheets;
@end
bundle.m
# import "Bundle.h"
@implementation Bundle
@dynamic name, ordering, id;
+ (void)initialize
{
[[self relationships] addObject:[ARRelationshipHasMany relationshipWithName:@"sheets"]];
}
@end
Model Sheet
sheet.h
@interface Sheet : ARBase
@property(readwrite, assign) NSString *name, *id, *bundleId;
@end
sheet.m
# import "sheet.h"
@implementation Sheet
@dynamic name, id, bundleId;
@end
===How to reproduce===
get all bundles [Bundle findAll]
Run instruments and select profile leaks. a lot of NSCFString
objects show up in the leaks. If however we remove the has many
relationships, the leaks disappear.
No comments found
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
ActiveRecord is an insanely easy to use database framework written in objective-c It's obviously "inspired" by (copying) the infamous ActiveRecord that comes with Rails(http://rubyonrails.org) But it tries to be more versatile when it comes to working with multiple connections.