From: Vadim Zeitlin Date: Sun, 22 Aug 2010 22:15:27 +0000 (+0000) Subject: Don't crash in wxOSX::wxClipboard::Clear() if initialization failed. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5623dce7cdcc168d81a378b0821569450411358f 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 --- diff --git a/src/osx/carbon/clipbrd.cpp b/src/osx/carbon/clipbrd.cpp index fd8e9a6d45..293173c9ec 100644 --- a/src/osx/carbon/clipbrd.cpp +++ b/src/osx/carbon/clipbrd.cpp @@ -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) {