I can drag and drop text within Scintilla documents without experiencing any crashes. I can also continue editing text after dragging and dropping. However, my application crashes later outside of Scintilla use. The matter of performing drag+drop in Scintilla has been inducing this later crash that is unconnected with Scintilla.
I've traced the source of the inducement to a specific line in ScintillaCocoa.mm. The attached diff shows the line I commented out. Without that line, I cannot induce a crash with drag+drop. With that line, I can do so without fail. I don't know what the fix is, as I know next to nothing about OSX, but I hope you can deduce something.
The NSGraphicsContext may be being used after deletion. Try adding a save/restore around that code: a [NSGraphicsContext saveGraphicsState]; before the line and a [NSGraphicsContext restoreGraphicsState]; after the call to CopyImageRectangle.
Added a save/restore as a potential fix as [77db85].
Related
Commit: [77db85]
Changed with [a8a642] to remove the extra context as it does not appear to really be needed.
Related
Commit: [a8a642]