Issue setting an icon for a file path

  • Hi,

    I have filed a bugreport on this, but just in case I am overlooking
    something:

    When saving a file I set an icon on the file path:
    [[NSWorkspace sharedWorkspace] setIcon:theIcon forFile:path
    options:NSExcludeQuickDrawElementsIconCreationOption];

    This works fine the first time in a session the document is saved. If
    I then make some changes and save again the same method results in a
    crash two calls down the line in _NSAddCompressedARGBIconFamilyElement:

    -[NSWorksspace setIcon:forFile:option:]
    _NSAddCompressedARGBIconFamilyElement

    The icon and the file path appear to be valid at the time of the call
    to setIcon:forFile:options:. The icon is created by locking focus on
    an NSImage and then drawing into it, and unlocking focus when done.

    Is there anything in the above information which suggests I am making
    a mistake, or is there a known bug and is there a work-around?

    Kind regards,
    António Nunes

    -----------------------------------------
    Accepting others as they are
    brings a wonderful freedom
    to your own mind.

    --The Peace Formula
    -----------------------------------------