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
This commit is contained in:
@@ -99,6 +99,15 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
|
|||||||
wxChoice::~wxChoice()
|
wxChoice::~wxChoice()
|
||||||
{
|
{
|
||||||
delete m_strings;
|
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 )
|
void wxChoice::GTKInsertComboBoxTextItem( unsigned int n, const wxString& text )
|
||||||
|
Reference in New Issue
Block a user