remove unnecessary Clear() and wrong delete
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77861 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -498,9 +498,6 @@ bool wxClipboard::AddData( wxDataObject *data )
|
|||||||
|
|
||||||
wxCHECK_MSG( data, false, wxT("data is invalid") );
|
wxCHECK_MSG( data, false, wxT("data is invalid") );
|
||||||
|
|
||||||
/* we can only store one wxDataObject */
|
|
||||||
Clear();
|
|
||||||
|
|
||||||
// in x11, the "copied data" hold by the program itself.
|
// in x11, the "copied data" hold by the program itself.
|
||||||
// so here just use m_data to hold the "copied data"
|
// so here just use m_data to hold the "copied data"
|
||||||
// use wxApp->ProcessXEvent to check whether there has
|
// use wxApp->ProcessXEvent to check whether there has
|
||||||
@@ -525,8 +522,6 @@ bool wxClipboard::AddData( wxDataObject *data )
|
|||||||
XChangeProperty(xdisplay, window, XA_CLIPBOARD, XA_STRING, 8, PropModeReplace,
|
XChangeProperty(xdisplay, window, XA_CLIPBOARD, XA_STRING, 8, PropModeReplace,
|
||||||
buf.data(), size);
|
buf.data(), size);
|
||||||
|
|
||||||
delete buf;
|
|
||||||
|
|
||||||
XSetSelectionOwner(xdisplay, XA_CLIPBOARD, window, CurrentTime);
|
XSetSelectionOwner(xdisplay, XA_CLIPBOARD, window, CurrentTime);
|
||||||
XFlush(xdisplay);
|
XFlush(xdisplay);
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user