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:
@@ -686,6 +686,13 @@ void wxRibbonButtonBar::SetArtProvider(wxRibbonArtProvider* art)
|
|||||||
|
|
||||||
wxRibbonControl::SetArtProvider(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);
|
wxClientDC temp_dc(this);
|
||||||
size_t btn_count = m_buttons.Count();
|
size_t btn_count = m_buttons.Count();
|
||||||
size_t btn_i;
|
size_t btn_i;
|
||||||
|
Reference in New Issue
Block a user