Memory leak with CIImage
Memory leak with CIImage
- Subject: Memory leak with CIImage
- From: email@hidden (Christian Schmitz)
- Date: Wed, 12 Sep 2007 06:29:53 +0200
- Organization: Monkeybread Software Germany
Hi,
if I load a raw image using
CIImage *img=[CIImage imageWithContentsOfURL:url];
I leak 16384000 bytes of memory for a 15.7 MB RAW file.
The call stack in ObjectAlloc is like this:
+[CIImage imageWithContentsOfURL:options];
-[CIImage initWithContentsOfURL:options:];
CGImageSourceCreateWithURL
CGImageSourceCreateWithFile
CGImageReadCreateWithFile
_CFDataCreateWithMappedFile
__CFDataInit
_CFRuntimeCreateInstance
CFAllocateAllocate
The following code in a normal C command line tool does not leak:
#include <Cocoa/Cocoa.h>
#include <QuartzCore/QuartzCore.h>
#include "stdio.h"
int main (int argc, const char * argv[]) {
NSApplicationLoad();
[NSApplication sharedApplication];
NSAutoreleasePool* pool=[[NSAutoreleasePool alloc] init];
NSURL *url=[NSURL
fileURLWithPath:@"/Users/cs/Desktop/D200.nef"];
CIImage *img=[CIImage imageWithContentsOfURL:url];
NSLog(@"url %@",url);
NSLog(@"img %@",img);
[pool release];
int i;
scanf("%d",&i);
return 0;
}
Now in my method I do the same.
NSURL *url=NewNSURL(c);
CIImage *img=[CIImage imageWithContentsOfURL:url];
with the NSApplication load code run earlier.
I have Autorelease pools around.
Even if I do not decide to use the img returned, it leaks.
Can someone please help me?
Does the GUI code around maybe set some cache options so the CFData
object is not released?
Gruß
Christian
--
Over 800 classes with 16000 functions in one REALbasic plug-in.
The Monkeybread Software Realbasic Plugin v7.5.
<http://www.monkeybreadsoftware.de/realbasic/plugins.shtml>
_______________________________________________
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