Re: Odd crash only when Toast running
Re: Odd crash only when Toast running
- Subject: Re: Odd crash only when Toast running
- From: Trygve Inda <email@hidden>
- Date: Tue, 02 Jun 2009 16:35:36 +0000
- Thread-topic: Odd crash only when Toast running
> On Tue, Jun 2, 2009 at 12:12 AM, Graham Cox <email@hidden> 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@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