Opened 9 years ago

Closed 8 years ago

#11547 closed defect (fixed)

[wxOSX / Cocoa] wxWidgetCocoaImpl::SetCursor

Reported by: jatupper Owned by: csomor
Priority: normal Milestone:
Component: wxOSX Version:
Keywords: Cc:
Blocked By: #11760, #11760 Blocking:
Patch: no


wxWidgetCocoaImpl::SetCursor consistently crashes in my applications when they try to use custom cursors. They are crashing at

        [(NSCursor*)cursor.GetHCURSOR() set];

in wxWidgetCocoaImpl::SetCursor. If I knew of a sample that used custom cursors, I'd check to see if that crashed as well. Squashing bugs in wxOSX/Carbon is a higher priority for me, so I'll have to return to this later if it hasn't been solved in the meantime... (Note: cursor.GetHCURSOR() was not returning NULL just prior to the crash.)

Attachments (1)

CustomCursorInControlSample.patch download (1.7 KB) - added by jatupper 8 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 8 years ago by mikk

I believe this is resolved by the patch attached to #11760, but I can't be certain as I get a different crash due to a different use of the cursor.

comment:2 Changed 8 years ago by vadz

  • Blocked By 11760 added

Changed 8 years ago by jatupper

comment:3 Changed 8 years ago by jatupper

Here is a patch that adds a custom cursor to the controls sample.


  • launch the patched controls sample
  • ensure that the wxListBox tab is selected (as it is by default)
  • move the cursor over the top left list box (with "one of my long...")


  • (on my local wxOSX-Carbon) a custom cursor shows up (I think my custom cursor patch(es) are currently outstanding on wxOSX-Carbon)
  • on wxOSX-Cocoa I don't get a crash, but I don't get a custom cursor; in the terminal "* -[NSCFArray isValid]: unrecognized selector sent to instance 0x63de50" shows up (repeatedly when I move the cursor in and out of the list box)

comment:4 Changed 8 years ago by csomor

  • Owner set to csomor
  • Status changed from new to accepted

shame on my, calling a method ..Create... and having it autorelease the parameter... I'll clean this up

comment:5 Changed 8 years ago by SC

  • Blocked By

(In #11760) (In [63958]) name change to correctly reflect the autorelease nature of the methods, removing double release, fixes #11547, fixes #11760

comment:6 Changed 8 years ago by jatupper

  • Resolution set to fixed
  • Status changed from accepted to closed

Yay! :-) wxOSX-Cocoa seems to have cursors that work!

Note: See TracTickets for help on using tickets.