Problem with Memory Leaks
Problem with Memory Leaks
- Subject: Problem with Memory Leaks
- From: "Jere Gmail" <email@hidden>
- Date: Sat, 26 Apr 2008 22:32:02 +0200
I've an image loaded into memory and I want to flip it. The problem is
that when I do it some memory is leaked. I've searched and sliced the
code but can't find where it is. Maybe someone can help. The function
I call is flip. If I call flip_v or needsDisplay only no leak
happens, but when both are called there is something wrong.
Thanks.
-(void)flip
{
[self flip_v];
[self setNeedsDisplay:TRUE];
}
- (void)drawRect:(NSRect)rect {
CIContext *context = [[NSGraphicsContext currentContext] CIContext];
CGRect cg = CGRectMake(NSMinX(rect), NSMinY(rect), NSWidth(rect),
NSHeight(rect));
if(context != nil)
[context drawImage:m_image atPoint:cg.origin fromRect: cg];
}
-(void)flip_v
{
CIImage *im=[[m_image copy] autorelease];
[m_image release];
CIFilter* filter = [CIFilter filterWithName: @"CIAffineTransform"];
[filter setValue: im forKey:@"inputImage"];
NSAffineTransform* transform = [NSAffineTransform transform];
[transform translateXBy:[im extent].size.width yBy: 0 ];
[transform scaleXBy: -1 yBy: 1];
[filter setValue:transform forKey:@"inputTransform"];
m_image=[filter valueForKey:@"outputImage"];
[m_image retain];
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden