Always add set the DataObject when starting the drag, regardless whether the event does, fixes crash

see #18167
This commit is contained in:
Stefan Csomor
2018-07-16 19:25:40 +02:00
parent cc83925147
commit b554cf0018

View File

@@ -850,6 +850,7 @@ outlineView:(NSOutlineView*)outlineView
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_BEGIN_DRAG, dvc, item);
itemString = ::ConcatenateDataViewItemValues(dvc, item);
itemObject->Add(new wxTextDataObject(itemString));
event.SetDataObject(itemObject);
// check if event has not been vetoed:
if (dvc->HandleWindowEvent(event) && event.IsAllowed() && (event.GetDataObject()->GetFormatCount() > 0))
{