Don't crash in wxOSX::wxClipboard::Clear() if initialization failed.
Creating the clipboard may fail (e.g. when running from a ssh session to an OS X machine), don't crash by passing NULL pointer to PasteboardClear() if this happens but assert and return instead. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -63,6 +63,8 @@ void wxClipboard::Clear()
|
|||||||
{
|
{
|
||||||
wxDELETE(m_data);
|
wxDELETE(m_data);
|
||||||
|
|
||||||
|
wxCHECK_RET( m_pasteboard, "Clipboard creation failed." );
|
||||||
|
|
||||||
OSStatus err = PasteboardClear( m_pasteboard );
|
OSStatus err = PasteboardClear( m_pasteboard );
|
||||||
if (err != noErr)
|
if (err != noErr)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user