From 11cbe6ef70004c3e52c9df13903dd8ab814b820e 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/trunk@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 69f71a1a13..1f21b00982 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -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--;)