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:
parent
b3c88024e8
commit
5a6c061f37
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user