File not closing
File not closing
- Subject: File not closing
- From: Trygve Inda <email@hidden>
- Date: Thu, 08 May 2003 20:50:23 +0200
This is possibly a Cocoa/Carbon hybrid question but...
I have a Carbon app that creates a series of image files in my App Support
folder. These images are set to the desktop with NotificationCenter. Once
the desktop is replaced, the old file (created by my app) is deleted.
I am running into a conflict with another developer's app (Cocoa) that is
reading the desktop picture whenever it changes and loading it for its own
use...
So my app sets the desktop, and then a Cocoa app reads in the new desktop
image, but somehow prevents me from deleting it after I have set a new image
about a minute later.
NSImage *deskImage = [[[NSImage alloc] initWithContentsOfFile:imagePath]
autorelease];
It seems this call (made by another app) prevents my app from being able to
delete the files it is generating.
As I am not experienced with Cocoa, what might be causing this? Is there a
better way to do this such that the file is not left open? What does
"autorelease" really do?
(In My Carbon app, FSDeleteObject returns -47 (file busy)).
Thanks,
Trygve
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.