~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);
}
void wxClipboard::GTKClearData(Kind kind)
{
wxDataObject *&data = Data(kind);
- if ( data )
- {
- delete data;
- data = NULL;
- }
+ wxDELETE(data);
}
bool wxClipboard::SetSelectionOwner(bool set)
{
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++ )
{