From d3eb5b38aa70488a23f4ae0c6c1e113d54102acd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 23 Dec 2018 17:02:45 +0100 Subject: [PATCH] Don't crash when drawing 0-sized wxAuiTabContainer in debug build Attempting to create a bitmap with 0 width or height results in an assertion failure, which is fatal, as it happens in wxEVT_PAINT handler and so quickly results in reentering it and asserting again and recursive assert failures terminate the application. Just avoid doing it, there is nothing to paint anyhow if the associated rectangle is empty. See https://github.com/wxWidgets/wxWidgets/pull/1085 --- src/aui/auibook.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index bbba6cd33e..7f66828770 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -414,6 +414,9 @@ void wxAuiTabContainer::Render(wxDC* raw_dc, wxWindow* wnd) if (!raw_dc || !raw_dc->IsOk()) return; + if (m_rect.IsEmpty()) + return; + wxMemoryDC dc; // use the same layout direction as the window DC uses to ensure that the