Hide wxChoice before destroying it with GTK+ 3
This works around GTK+ critical error messages that we get otherwise with GTK+
since the change done in its commit 7401794de6b084fea469af297b7c144724b8492c
which appeared in 3.22.8 release and is still present in the latest version.
These messages happen because gtk_combo_box_popdown() ends up being called
during the widget destruction if it's still shown, so just hide the combobox
before destroying it to avoid them.
Closes https://github.com/wxWidgets/wxWidgets/pull/449
(cherry picked from commit 404f0f8587)
This commit is contained in:
committed by
Paul Cornett
parent
397e6e9e35
commit
8fad217a6f
@@ -98,6 +98,15 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
|
||||
wxChoice::~wxChoice()
|
||||
{
|
||||
delete m_strings;
|
||||
|
||||
#ifdef __WXGTK3__
|
||||
// At least with GTK+ 3.22.9, destroying a shown combobox widget results in
|
||||
// a Gtk-CRITICAL debug message when the assertion fails inside a signal
|
||||
// handler called from gtk_widget_unrealize(), which is annoying, so avoid
|
||||
// it by hiding the widget before destroying it -- this doesn't look right,
|
||||
// but shouldn't do any harm neither.
|
||||
Hide();
|
||||
#endif // __WXGTK3__
|
||||
}
|
||||
|
||||
void wxChoice::GTKInsertComboBoxTextItem( unsigned int n, const wxString& text )
|
||||
|
||||
Reference in New Issue
Block a user