X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c54277e538b22e5b388030c70b47d050455432f..f25cb0af6bad7390e3d29ba9dc58815ea5115d41:/src/gtk/clipbrd.cpp?ds=sidebyside diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index a3544a4103..56fa9e1eb8 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -75,6 +75,10 @@ public: ~wxClipboardSync() { + // ensure that there is a running event loop: this might not be the + // case if we're called before the main event loop startup + wxEventLoopGuarantor ensureEventLoop; + while (ms_clipboard) wxEventLoopBase::GetActive()->YieldFor(wxEVT_CATEGORY_CLIPBOARD); } @@ -670,10 +674,11 @@ bool wxClipboard::GetData( wxDataObject& data ) { wxCHECK_MSG( m_open, false, wxT("clipboard not open") ); - // get all supported formats from wxDataObjects - const size_t count = data.GetFormatCount(); + // get all supported formats from wxDataObjects: notice that we are setting + // the object data, so we need them in "Set" direction + const size_t count = data.GetFormatCount(wxDataObject::Set); wxDataFormatArray formats(new wxDataFormat[count]); - data.GetAllFormats(formats.get()); + data.GetAllFormats(formats.get(), wxDataObject::Set); for ( size_t i = 0; i < count; i++ ) {