From 5623dce7cdcc168d81a378b0821569450411358f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 22 Aug 2010 22:15:27 +0000 Subject: [PATCH] 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 --- src/osx/carbon/clipbrd.cpp | 2 ++ 1 file changed, 2 insertions(+) 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) { -- 2.50.0