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:
Vadim Zeitlin
2010-08-22 22:15:27 +00:00
parent 45d1c40a91
commit 5623dce7cd

View File

@@ -63,6 +63,8 @@ void wxClipboard::Clear()
{
wxDELETE(m_data);
wxCHECK_RET( m_pasteboard, "Clipboard creation failed." );
OSStatus err = PasteboardClear( m_pasteboard );
if (err != noErr)
{