Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

NSCFString Memory Leak caused by HasMany Relationship

#16

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.

Reported by Udit Sajjanhar · October 12th, 2011 @ 11:01 AM

State: new
Milestone: none
Assigned to: nobody

Activity

No comments yet.

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.