• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problem with Memory Leaks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Problem with Memory Leaks
      • From: Michael Vannorsdel <email@hidden>
  • Prev by Date: Re: Not showing window at Document-Based application
  • Next by Date: Re: Problem with Memory Leaks
  • Previous by thread: Re: Debugger at odds with reality? [SOLVED]
  • Next by thread: Re: Problem with Memory Leaks
  • Index(es):
    • Date
    • Thread