From 1f054661a4417e78d437bd78fd0eb5838ba4c962 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sat, 13 Dec 2014 17:40:29 +0000 Subject: [PATCH] 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/branches/WX_3_0_BRANCH@78270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/toplevel.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 5aec493823..35942a87d7 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -1387,14 +1387,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--;)