Ticket #11760 (closed defect: fixed)
Using custom cursors in wxOSX-Cocoa crashes the program
|Reported by:||mikk||Owned by:|
|Blocking:||11547, 11547, 11547, 11547|
Using a cursor created from an image, via wxCursor(const wxImage& image), causes the application to crash for wxOSX-Cocoa.
This is due to the fact that wxMacCocoaCreateCursorFromCGImage creates the cursor using an image returned from wxOSXCreateNSImageFromCGImage and then releases it. However, since wxOSXCreateNSImageFromCGImage marks the image for autorelease, wxMacCocoaCreateCursorFromCGImage should not release the image after creating the cursor.
I believe this patch also fixes #11547, though I can't be completely certain as I get a different crash location due to a different use of the cursor.