Fix asserts in wxRibbonButtonBar during destruction

Don't do anything when the art provider is being reset during the window
destruction: this is at best useless and is actually harmful as the code
ended up by requesting the DPI of the TLW parent which could already be
half-destroyed.
This commit is contained in:
Vadim Zeitlin 2019-10-26 17:24:46 +02:00
parent e303231d00
commit bf99c7ae9f

View File

@ -686,6 +686,13 @@ void wxRibbonButtonBar::SetArtProvider(wxRibbonArtProvider* art)
wxRibbonControl::SetArtProvider(art);
// There is no need to do anything else when the art provider is reset to
// null during our destruction and this actually results in problems during
// program shutdown due to trying to get DPI of the already destroyed TLW
// parent.
if (!art)
return;
wxClientDC temp_dc(this);
size_t btn_count = m_buttons.Count();
size_t btn_i;