Commit de66c65f authored by Ian McInerney's avatar Ian McInerney
Browse files

Don't immediately read back clipboard data on OSX

This causes an ASAN error because something in the wx
clipboard cache is incorrect (so it tries to copy more
data than it has available). Closing the clipboard and
reopening to read works (since close clears the cache).
parent dac12a6d
Pipeline #132640153 canceled with stages
in 46 minutes and 20 seconds
......@@ -199,15 +199,20 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected )
clipboard->Flush();
#ifndef __WXOSX__
// This section exists to return the clipboard data, ensuring it has fully
// been processed by the system clipboard. This appears to be needed for
// extremely large clipboard copies on asynchronous linux clipboard managers
// such as KDE's Klipper
// such as KDE's Klipper. However, a read back of the data on OSX before the
// clipboard is closed seems to cause an ASAN error (heap-buffer-overflow)
// since it uses the cached version of the clipboard data and not the system
// clipboard data.
{
wxTextDataObject data;
clipboard->GetData( data );
( void )data.GetText(); // Keep unused variable
}
#endif
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment