From 0079e9a27895540d6dc3649c19e4e39176dbd5e1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 19 Jul 2020 19:19:56 +0200 Subject: [PATCH] Don't assert for unsupported logical functions in wxGCDC wxGCDC is often used from wxEVT_PAINT handler and showing an assert dialog from any of its methods results in wxEVT_PAINT being generated again, resulting in another assert and abort, which is not useful, so remove this assert to at least avoid crashes whenever unsupported logical function is used, as it happens e.g. in the "Mask Screen" of our own drawing sample. --- src/common/dcgraph.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/dcgraph.cpp b/src/common/dcgraph.cpp index 5da2fe531d..1ab8f4c494 100644 --- a/src/common/dcgraph.cpp +++ b/src/common/dcgraph.cpp @@ -1045,7 +1045,9 @@ bool wxGCDCImpl::DoStretchBlit( wxCompositionMode mode = TranslateRasterOp(logical_func); if ( mode == wxCOMPOSITION_INVALID ) { - wxFAIL_MSG( wxT("Blitting is not supported with this logical operation.") ); + // Do *not* assert here, this function is often call from wxEVT_PAINT + // handler and asserting will just result in a reentrant call to the + // same handler and a crash. return false; }