don't use invalid wxIconBundles, it results in asserts after recent changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45319 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -327,7 +327,7 @@ gtk_frame_realized_callback( GtkWidget * WXUNUSED(widget),
|
||||
|
||||
// reset the icon
|
||||
wxIconBundle iconsOld = win->GetIcons();
|
||||
if ( iconsOld.GetIcon(-1).Ok() )
|
||||
if ( !iconsOld.IsEmpty() )
|
||||
{
|
||||
win->SetIcon( wxNullIcon );
|
||||
win->SetIcons( iconsOld );
|
||||
@@ -1088,7 +1088,13 @@ void wxTopLevelWindowGTK::SetTitle( const wxString &title )
|
||||
|
||||
void wxTopLevelWindowGTK::SetIcon( const wxIcon &icon )
|
||||
{
|
||||
SetIcons( wxIconBundle( icon ) );
|
||||
// passing wxNullIcon to SetIcon() is possible (it means that we shouldn't
|
||||
// have any icon), but adding an invalid icon to wxIconBundle is not
|
||||
wxIconBundle icons;
|
||||
if ( icon.Ok() )
|
||||
icons.AddIcon(icon);
|
||||
|
||||
SetIcons(icons);
|
||||
}
|
||||
|
||||
void wxTopLevelWindowGTK::SetIcons( const wxIconBundle &icons )
|
||||
@@ -1097,6 +1103,9 @@ void wxTopLevelWindowGTK::SetIcons( const wxIconBundle &icons )
|
||||
|
||||
wxTopLevelWindowBase::SetIcons( icons );
|
||||
|
||||
if ( icons.IsEmpty() )
|
||||
return;
|
||||
|
||||
GdkWindow* window = m_widget->window;
|
||||
if (!window)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user