Allow setting icon before m_widget is valid.

There is no need to require a valid m_widget,
the "realize" handler will take care of things later.
Closes #16731


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2014-12-13 17:40:29 +00:00
parent c7bc7b467a
commit 11cbe6ef70

View File

@@ -1383,14 +1383,12 @@ void wxTopLevelWindowGTK::SetTitle( const wxString &title )
void wxTopLevelWindowGTK::SetIcons( const wxIconBundle &icons )
{
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
base_type::SetIcons(icons);
// Setting icons before window is realized can cause a GTK assertion if
// another TLW is realized before this one, and it has this one as it's
// transient parent. The life demo exibits this problem.
if (gtk_widget_get_realized(m_widget))
if (m_widget && gtk_widget_get_realized(m_widget))
{
GList* list = NULL;
for (size_t i = icons.GetIconCount(); i--;)