X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/58b1ae5e7297f9a8d410ae2640c0a49ec87368bf..ab67e8874db324fab5223cc8d5dff8a8de3e2b77:/src/osx/cocoa/dataview.mm diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index 2e195d0317..632af4b04b 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -926,7 +926,8 @@ outlineView:(NSOutlineView*)outlineView size_t const dataSize = event.GetDataObject()->GetDataSize(idDataFormat); size_t const dataBufferSize = sizeof(wxDataFormatId)+dataSize; // variable definitions (used in all case statements): - wxMemoryBuffer dataBuffer(dataBufferSize); + // give additional headroom for trailing NULL + wxMemoryBuffer dataBuffer(dataBufferSize+4); dataBuffer.AppendData(&idDataFormat,sizeof(wxDataFormatId)); switch (idDataFormat) @@ -958,7 +959,6 @@ outlineView:(NSOutlineView*)outlineView break; default: wxFAIL_MSG("Data object has invalid or unsupported data format"); - [dataArray release]; return NO; } } @@ -976,7 +976,6 @@ outlineView:(NSOutlineView*)outlineView } else { - [dataArray release]; delete itemObject; return NO; // dragging was vetoed or no data available }