use wxCharTypeBuffer replace unsigned char pointer

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-09-23 17:44:25 +00:00
parent b3c88024e8
commit 5a6c061f37

View File

@ -519,11 +519,11 @@ bool wxClipboard::AddData( wxDataObject *data )
Window window = RootWindow(xdisplay, xscreen);
size_t size = m_data->GetDataSize(wxDF_UNICODETEXT);
unsigned char* buf = (unsigned char*)malloc(size);
m_data->GetDataHere(wxDF_UNICODETEXT, buf);
wxCharTypeBuffer<unsigned char> buf(size);
m_data->GetDataHere(wxDF_UNICODETEXT, buf.data());
XChangeProperty(xdisplay, window, XA_CLIPBOARD, XA_STRING, 8, PropModeReplace,
buf, size);
buf.data(), size);
delete buf;