Mail keeps attached files open for a random time interval

Originator:adamnhjl
Number:rdar://9194336 Date Originated:27-Mar-2011 08:56 PM
Status:Duplicate/5876218 Resolved:
Product:Mail Product Version:4.5 (1084)
Classification:Other bug Reproducible:Sometimes
 
Summary: After attaching an image file to a message in Apple Mail and sending the message, the file is kept open, not indefinitely, but often for a substantial amount of time, preventing the user from deleting the file.

Steps to Reproduce: Start composing a new message in Mail. Drag an image file to the composing window (a JPEG or PNG for instance). Right-click the attached image to display the contextual menu (isn't strictly necessary, but it usually makes Mail close the file later). Send the message and wait until it's sent. Move the file to trash and try to delete it.

Expected Results: You should be able to delete the file, since Mail doesn't need it anymore.

Actual Results: The file cannot be deleted, it's still open.

Regression: It doesn't seem to happen with non-image files. It is not caused by any Mail plug-ins (I've tried removing them all). I use my IMAP account to store Sent messages, which may or may not be part of the problem (but I always wait until Mail is done with everything).

Notes: The files are usually kept open for a few minutes. If I right-click the image before sending it's replicable most of the time. If I remember correctly the objects corresponding to these files (most likely NSFileWrappers) are always hanging around until some thread ends, which seems to imply that they are autoreleased in it's top level pool. (It's been a long time since I've tried to debug this, so I may be wrong. The problem's been there for quite some time.)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!