From cf5861623960de7d066a4532ea005b6897fa82ee Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 25 Mar 2009 13:31:38 +0000 Subject: [PATCH] don't crash in wxFAIL and wxCHECK if assertion handler is NULL git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/debug.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/wx/debug.h b/include/wx/debug.h index 29d4deac3b..593af341d7 100644 --- a/include/wx/debug.h +++ b/include/wx/debug.h @@ -259,7 +259,10 @@ extern void WXDLLIMPEXP_BASE wxOnAssert(const char *file, // wxFAIL is a special form of assert: it always triggers (and so is // usually used in normally unreachable code) #define wxFAIL_COND_MSG(cond, msg) \ - wxOnAssert(__FILE__, __LINE__, __WXFUNCTION__, cond, msg) + if ( !wxTheAssertHandler ) \ + {} \ + else \ + wxOnAssert(__FILE__, __LINE__, __WXFUNCTION__, cond, msg) #define wxFAIL_MSG(msg) wxFAIL_COND_MSG("Assert failure", msg) #define wxFAIL wxFAIL_MSG((const char*)NULL) #else // !wxDEBUG_LEVEL