Re: Crash in dragImageForSelection


John Brownie
 

Further experimentation reveals that the problem is (as far as I can tell) due to the code that handles a click updating the window. I seem to get a race condition: if I click, hold and drag, the drag image is created (though weirdly distorted to match the rect I supply), but a click and drag in one motion causes the crash.

Updating the window may cause the text view to get a new string supplied, so I'm guessing that it is somehow hitting the text view when the string is being replaced, causing the problem. How that happens, I'm not sure, since everything is on the main thread (since it's UI stuff), which shouldn't cause threading issues like I'm imagining.

Could I be on the right track here, or what else could the problem be?

John
--
John Brownie
Mussau-Emira language, New Ireland Province, Papua New Guinea
Kouvola, Finland

Join cocoa@apple-dev.groups.io to automatically receive all group messages.