From 2969cefb3a0874697f9f384d48adcbf480f86baa Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 9 Jan 2019 10:05:51 +0000 Subject: [PATCH] Fix crash when calling wxRadioBox::Show() before Create() in wxQt This notable happened when the radio box was loaded from XRC. Closes https://github.com/wxWidgets/wxWidgets/pull/1126 --- src/qt/radiobox.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index 2ea62910b3..4e58afed50 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -248,6 +248,12 @@ bool wxRadioBox::Show(unsigned int n, bool show) bool wxRadioBox::Show( bool show ) { + if ( !wxControl::Show(show) ) + return false; + + if ( !m_qtGroupBox ) + return false; + if( m_qtGroupBox->isVisible() == show ) { for( unsigned int i = 0; i < GetCount(); ++i )