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:
Vadim Zeitlin
2018-12-23 17:02:45 +01:00
parent db4c983881
commit d3eb5b38aa

View File

@@ -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