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:
@@ -519,11 +519,11 @@ bool wxClipboard::AddData( wxDataObject *data )
|
|||||||
Window window = RootWindow(xdisplay, xscreen);
|
Window window = RootWindow(xdisplay, xscreen);
|
||||||
|
|
||||||
size_t size = m_data->GetDataSize(wxDF_UNICODETEXT);
|
size_t size = m_data->GetDataSize(wxDF_UNICODETEXT);
|
||||||
unsigned char* buf = (unsigned char*)malloc(size);
|
wxCharTypeBuffer<unsigned char> buf(size);
|
||||||
m_data->GetDataHere(wxDF_UNICODETEXT, buf);
|
m_data->GetDataHere(wxDF_UNICODETEXT, buf.data());
|
||||||
|
|
||||||
XChangeProperty(xdisplay, window, XA_CLIPBOARD, XA_STRING, 8, PropModeReplace,
|
XChangeProperty(xdisplay, window, XA_CLIPBOARD, XA_STRING, 8, PropModeReplace,
|
||||||
buf, size);
|
buf.data(), size);
|
||||||
|
|
||||||
delete buf;
|
delete buf;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user