MouseEvent crash fix on wxWindow Destroy

If the event handler destroys the wxWindow, then the subsequent call to SetupCursor(event) will miserably fail .
Moved setting the cursor before the event is handled.
This commit is contained in:
tommash
2017-12-15 15:01:26 +01:00
committed by GitHub
parent 276d96b583
commit 3de6d1eb17

View File

@@ -3579,11 +3579,11 @@ bool wxWidgetCocoaImpl::DoHandleKeyEvent(NSEvent *event)
bool wxWidgetCocoaImpl::DoHandleMouseEvent(NSEvent *event)
{
(void)SetupCursor(event);
wxMouseEvent wxevent(wxEVT_LEFT_DOWN);
SetupMouseEvent(wxevent , event) ;
bool result = GetWXPeer()->HandleWindowEvent(wxevent);
(void)SetupCursor(event);
return result;
}