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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user