I'm using wxPython 4.1.1a1..., a recent daily build on macOS Catalina and Windows 10. I believe this wxPython is based on wxWidgets 4.1.3.
In my app, users can re-arrange items in a TreeCtrl using drag-and-drop. This has worked well on Windows but when I drop a tree node the second time on macOS, the program crashes with an "illegal hardware instruction" message. The crash occurs after execution of the DoDragDrop method is complete. That is, the drag-and-drop operation is successfully completed before the crash occurs.
I use a CustomDataObject during drag-and-drop. If I replace the CustomDataObject with a TextDataObject, the program does not crash. And if I use a CustomDataObject with copy-and-paste through the Clipboard instead of drag-and-drop, the program does not crash.
As a result, I believe there is an interaction between the CustomDataObject and the drag-and-drop system that is behind this error. And as I say, this only occurs on macOS, with the code working correctly on Windows.
Unfortunately, I need to use a CustomDataObject rather than a TextDataObject in my code.
It was also reported on the wxPython mailing list that this crash did not occur using wxPython 4.0.7-post2, a version of wxPython that is not *that* old in the grand scheme of things. However, I need the later wxPython for some MediaCtrl fixes related to Catalina. This suggests that the problem was introduced when Robin Dunn upgraded the wxWidgets version he uses to build wxPython for his 4.1 version.
I have included a wxPython sample program. You can select an item in a TreeCtrl and use either drag-and-drop or cut-and-paste (through the Edit menu) to re-arrange the items in the tree. You'll see that both methods work on Windows but only copy-and-paste works on macOS, with the program crashing on the second drop using drag-and-drop. Also, if you alter the boolean value in the first line of the program, the code will use TextDataObject instead of CustomDataObject, and then both cut-and-paste and drag-and-drop will work on both platforms.
I apologize that I don't have a C-based wxWidgets sample for you, but I was unable to get drag-and-drop working in C.
Thanks in advance for looking into this.