Always initialize just added wxRibbonButtonBar field

Initialize m_ribbonBar added in the previous commit to NULL before
setting it to the correct value later, when wxRibbonButtonBar is fully
created.

See #19249.

Co-Authored-By: Maarten Bent <MaartenBent@users.noreply.github.com>
This commit is contained in:
Vadim Zeitlin
2021-09-05 18:28:38 +02:00
parent 706ab2c300
commit 2bab87b140

View File

@@ -973,8 +973,10 @@ void wxRibbonButtonBar::OnSize(wxSizeEvent& evt)
void wxRibbonButtonBar::CommonInit(long WXUNUSED(style))
{
if ( m_parent )
m_ribbonBar = GetAncestorRibbonBar();
// This can initialize it to NULL when we're called from the default ctor,
// but will set it to the correct value when used from non-default ctor or
// Create() later.
m_ribbonBar = GetAncestorRibbonBar();
m_bitmap_size_large = wxSize(32, 32);
m_bitmap_size_small = wxSize(16, 16);