> On Tue, Jun 2, 2009 at 12:12 AM, Graham Cox <[email protected]> wrote:
>> 
>> On 02/06/2009, at 4:23 PM, Trygve Inda wrote:
> 
>>> The only thing I can find that may be related (based on [NSWindow
>>> displayIfNeeded] being in the report) is that my app has a single window
>>> with a single view and I call:
>>> 
>>> NSImage*    theImage = [[[NSImage alloc]
>>> initWithContentsOfFile:mapImagePath] autorelease];
>>> 
>>> [window orderFront:self];
>> 
>> You could try doing this step first, before alloc/init the image. I'm
>> wondering if this is causing a drain of the autorelease pool.
> 
> It can't cause the autorelease pool related to the current method to
> be draining.
> 
>>> [imageView setImage:theImage];
>>> [imageView setNeedsDisplay:YES];
>>> 
>>> The file that this image comes from will be deleted later on, but once
>>> initWithContentsOfFile is called, I assume it no longer needs the file,
>>> right?
> 
> No it might still need the file. NSImage is often lazy about what it
> does so as to not waste resources until they are needed. Can you
> outline what you are doing with the file after you create the NSImage
> instance? Are you writing to it again, etc.?
> 
> As a test I would try sending an -isValid message to the image
> instance (think isValid is the correct name) after creating it.

I am loading an image form disk, assigning it to an ImageView and then later
the file will be deleted, a new one created (different file name) and the
new one will be assigned to the image. The delete/replace is at least a
minute between intervals and I call setNeedsDisplay right away so I don't
think it is trying to poll the file later.

Trygev


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to