From dfdbba7ebc00775fef90414bb542522e99a5384c Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 9 Jan 2019 09:45:02 +0000 Subject: [PATCH] Fix wxQT crash if wxRadioBox is created without wxRA_SPECIFY_XXX Fall back to wxRA_SPECIFY_COLS if neither it nor wxRA_SPECIFY_ROWS is given instead of not initializing m_qtBoxLayout at all in this case and subsequently crashing due to it. Closes https://github.com/wxWidgets/wxWidgets/pull/1125 --- src/qt/radiobox.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index be0dada8eb..2ea62910b3 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -146,6 +146,9 @@ bool wxRadioBox::Create(wxWindow *parent, m_qtGroupBox->setTitle( wxQtConvertString( title ) ); m_qtButtonGroup = new wxQtButtonGroup( m_qtGroupBox, this ); + if ( !(style & (wxRA_SPECIFY_ROWS | wxRA_SPECIFY_COLS)) ) + style |= wxRA_SPECIFY_COLS; + // wxRA_SPECIFY_COLS means that we arrange buttons in // left to right order and GetMajorDim() is the number of columns while // wxRA_SPECIFY_ROWS means that the buttons are arranged top to bottom and